mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1163418 - Remove use of CPOWs in browser_bookmark_titles.js. r=felipe
This commit is contained in:
parent
eb98b5c082
commit
65c8df357c
@ -86,16 +86,11 @@ function* checkBookmark(uri, expected_title) {
|
||||
// custom page load listener.
|
||||
function promisePageLoaded(browser)
|
||||
{
|
||||
return new Promise(resolve => {
|
||||
browser.addEventListener("DOMContentLoaded", function pageLoaded(event) {
|
||||
browser.removeEventListener("DOMContentLoaded", pageLoaded, true);
|
||||
|
||||
if (event.originalTarget != browser.contentDocument ||
|
||||
event.target.location.href == "about:blank") {
|
||||
info("skipping spurious load event");
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
}, true);
|
||||
return ContentTask.spawn(browser, null, function* () {
|
||||
yield ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true,
|
||||
(event) => {
|
||||
return event.originalTarget === content.document &&
|
||||
event.target.location.href !== "about:blank"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user