mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 22:28:59 +02:00
15 lines
543 B
JavaScript
15 lines
543 B
JavaScript
function waitForPdfJS(browser, url) {
|
|
// Runs tests after all "load" event handlers have fired off
|
|
return ContentTask.spawn(browser, url, async function(contentUrl) {
|
|
await new Promise((resolve) => {
|
|
// NB: Add the listener to the global object so that we receive the
|
|
// event fired from the new window.
|
|
addEventListener("documentload", function listener() {
|
|
removeEventListener("documentload", listener, false);
|
|
resolve();
|
|
}, false, true);
|
|
|
|
content.location = contentUrl;
|
|
});
|
|
});
|
|
}
|