mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
782fce224f
--HG-- extra : rebase_source : 183331b565d8c0577c9ba60a89f3c1ea6b11af9a
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
|
|
|
// Some of the code we want to provide to chrome mochitests is in another file
|
|
// so we can share it with the mochitest shim window, thus we need to load it.
|
|
Services.scriptloader.loadSubScript("chrome://webapprt/content/mochitest.js",
|
|
this);
|
|
|
|
/**
|
|
* Load the webapp in the app browser.
|
|
*
|
|
* @param {String} manifestURL
|
|
* @see becomeWebapp
|
|
* @param {Object} parameters
|
|
* @see becomeWebapp
|
|
* @param {Function} onLoad
|
|
* The callback to call once the webapp is loaded.
|
|
*/
|
|
function loadWebapp(manifest, parameters, onLoad) {
|
|
becomeWebapp(manifest, parameters, function onBecome() {
|
|
function onLoadApp() {
|
|
gAppBrowser.removeEventListener("load", onLoadApp, true);
|
|
onLoad();
|
|
}
|
|
gAppBrowser.addEventListener("load", onLoadApp, true);
|
|
gAppBrowser.setAttribute("src", WebappRT.launchURI.spec);
|
|
});
|
|
}
|