The QML component that binds to a QML WebView and exposes the Unity WebApps API to it's javascript. More...
Import Statement: | import Ubuntu.UnityWebApps . |
Examples:
UnityWebApps { id: webapps name: "MyApp" bindee: webView }
On the page's javascript side, an event is being sent to the document when the API is exposed and ready to be used: "ubuntu-webapps-api-ready".
So a typical pattern for the page's javascript could be:
function init() { // The Unity APIs are available throuhg external.getUnityObject var Unity = external.getUnityObject(1); } if (!external.getUnityObject) { document.addEventListener ("ubuntu-webapps-api-ready", function () { init(); }); }
Used only for testing. Allows optional (not the default ones) client api to be used instead of the default one.
Used only for testing. Allows an optional a homepage to be specified when running a local http server.
Holds a reference to the object that webapps are to be injected in.
The UnityWebApps QML component expects any bindee to duck-type with the following IDL signature:
method getUnityWebappsProxies()
that should return a BindeeExports:
interface BindeeExports { method injectUserScripts(string userScriptUrls); method sendToPage(string message); method loadingStartedConnect(Callback onLoadingStarted); method messageReceivedConnect(Callback onMessageReceived); method navigateTo(string url); }
Used only for testing. Allows optional (not the default ones) mocked backends to be used.
Used only for testing. Allows optional (not the default ones) client api to be used instead of the default one.
An optional model used in conjunction with the 'name' property as a location for looking up the desired webapps.
Holds the name of the application that is run as a WebApp. It should be used in conjunction with a model. The 'name' property is then used while looking up for the webapp in the set of locally installed ones.
The name should not change once it has been set. (?)