question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embedded applications api

See original GitHub issue

Actual Behavior

The app allows you to embed applications such as games with the lbry-package format, but they are just isolated static websites and can’t take advantage of the lbry-sdk.

Expected Behavior

I don’t exactly sure what should be the expected behavior, that’s why I’m opening this issue to discuss this feature…

If you have some ideas or thoughts on this feel free to leave a comment.

Suggested Solutions

Create an api that works like a bridge between the lbry-desktop app and the lbry-package app:

  • This will allow developers to access to certain info and request some events such as sending transactions in a “secure way” directly inside the application itself.

  • Users should have control of which apps can communicate to this API and what permissions and features can access.

This is possible to achieve with a preload script attached to the webview:

When disabling Node.js integration, you can still expose APIs to your website that do consume Node.js modules or features. Preload scripts continue to have access to require and other Node.js features, allowing developers to expose a custom API to remotely loaded content.

https://github.com/electron/electron/blob/master/docs/tutorial/security.md#2-do-not-enable-nodejs-integration-for-remote-content

Example

MyApp.lbry-package/index.html

<script>
    // Accessible from window.LBRY_BRIDGE ( no need to install or do any magic tricks ) 
    button.onClick = () => LBRY_BRIDGE.doSomething("Purchase a claim or send a transaction!");
</script>

Simple app handler

onDoSomething(e) => {
  // Request for permission
  const granted = requestAccess();
  if (granted) {
     // Continue and notify success...
    success();
  } else {
    // User blocked the request...
    cancel();
  }
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
btzr-iocommented, Jun 29, 2019

@EnigmaCurry Yes, that’s how it should work 👍

1reaction
EnigmaCurrycommented, Jun 29, 2019

The LBRY_BRIDGE can do do the http request I imagine on the nodejs side, so the embedded app would just speak the same language as the REST api, but would do it through the bridge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application Programming Interface [API] - Embedded Artistry
An application programming interface (API) is an interface or communication protocol between a client and a server intended to simplify the building of ......
Read more >
5 Top Open-source features and API for embedded systems ...
5 Top Open-source features and API for embedded systems and edge · 1. Bootloader for embedded systems · 2. A gate between embedded/edge...
Read more >
Embedded Basics – API's vs HAL's
An API is an application programming interface that defines a set of routines, protocols and tools for creating an application. An API ......
Read more >
Introduction to Embedded Systems - Basics - API - Google Sites
An Application Programming Interface (API) is a set of routines, protocols, and tools that say how different software components should interact with each ......
Read more >
What is an API? (And How It Can Help With Embedded ... - Yurbi
API stands for application programming interface. It serves as a way for one program to offer services or communicate with another program. For ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found