5.0.1 • Published 1 year ago

@prescrire/bridge v5.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Embedded Bridge

This Bridge can be embedded into a BrowserView and InAppBrowser. It provides the mentioned windows with access to API methods of the Bridge marked as external. An object window.EmbeddedBridge is created in the window scope. There is a public method window.EmbeddedBridge.api({string}methodName, {object}params) which returns a promise (this is an async function). It invokes API methods of the app. In addition, EmbeddedBridge invokes "get-supported-api-methods" method automatically on initialization and sets returned results to an attribute named supported_api_methods to a body element of the auth page: <body supported_api_methods="close-authentication get-supported-api-methods"> This helps to utilize CSS rules like [supported_api_methods~="close-authentication"] button {display:inline} to control UI element appearance reflecting API capabilities.

Usage

Include the scriptembedded/index.js to your page in the end of <body> tag:

<html>
    <head>
      ...
    </head>
    <body>
      ...
      <script src="[bridge script path]"></script>
    </body>
</html>
5.0.1

1 year ago

5.0.0

1 year ago

4.0.1

2 years ago

3.0.4

3 years ago

3.0.3

3 years ago

4.0.0

3 years ago

3.0.2

3 years ago

2.0.3

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago