var { AppConstants } = ChromeUtils.importESModule( "resource://gre/modules/AppConstants.sys.mjs"
);
/** * Load the browser with the given url and then invokes the given function.
*/ function openBrowserWindow(aFunc, aURL, aRect) {
gBrowserContext.testFunc = aFunc;
gBrowserContext.startURL = aURL;
gBrowserContext.browserRect = aRect;
addLoadEvent(openBrowserWindowIntl);
}
/** * Close the browser window.
*/ function closeBrowserWindow() {
gBrowserContext.browserWnd.close();
}
/** * Return the browser window object.
*/ function browserWindow() { return gBrowserContext.browserWnd;
}
/** * Return the document of the browser window.
*/ function browserDocument() { return browserWindow().document;
}
function openBrowserWindowIntl() { var params = "chrome,all,dialog=no,non-remote"; var rect = gBrowserContext.browserRect; if (rect) { if ("left" in rect) {
params += ",left=" + rect.left;
} if ("top" in rect) {
params += ",top=" + rect.top;
} if ("width" in rect) {
params += ",width=" + rect.width;
} if ("height" in rect) {
params += ",height=" + rect.height;
}
}
whenDelayedStartupFinished(browserWindow(), function () {
addA11yLoadEvent(startBrowserTests, browserWindow());
});
}
function startBrowserTests() { if (gBrowserContext.startURL) { // Make sure the window is the one loading our URL. if (currentBrowser().contentWindow.location != gBrowserContext.startURL) {
setTimeout(startBrowserTests, 0); return;
} // wait for load
addA11yLoadEvent(gBrowserContext.testFunc, currentBrowser().contentWindow);
} else {
gBrowserContext.testFunc();
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.