SimpleTest.registerCleanupFunction(function () { for (const cleanup of gAttachCleanups) {
cleanup();
}
});
/** * Open a tab, load the url, wait for it to signal its readiness, * connect to this tab via DevTools protocol and return. * * Returns an object with a few helpful attributes: * - commands {Object}: The commands object defined by modules from devtools/shared/commands * - target {TargetFront}: The current top-level target front. * - doc {HtmlDocument}: the tab's document that got opened
*/
async function attachURL(url) { // Get the current browser window const gBrowser =
Services.wm.getMostRecentWindow("navigator:browser").gBrowser;
// open the url in a new tab, save a reference to the new inner window global object // and wait for it to load. The tests rely on this window object to send a "ready" // event to its opener (the test page). This window reference is used within // the test tab, to reference the webpage being tested against, which is in another // tab. const windowOpened = BrowserTestUtils.waitForNewTab(gBrowser, url); const win = window.open(url, "_blank");
await windowOpened;
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.