A bridge between electron main process, application main process, and iframes of application main process
npm install @prescrire/bridgeThis 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:
This helps to utilize CSS rules like [supported_api_methods~="close-authentication"] button {display:inline} to control UI element appearance reflecting API capabilities.
Include the scriptembedded/index.js to your page in the end of tag:
``html``
...
...