Source code
Revision control
Copy as Markdown
Other Tools
async function newFocusedWindow(trigger) {
let winPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let delayedStartupPromise = BrowserTestUtils.waitForNewWindow();
await trigger();
let win = await winPromise;
await BrowserTestUtils.waitForContentEvent(
win.gBrowser.selectedBrowser,
"MozAfterPaint"
);
await delayedStartupPromise;
return win;
}