mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1066394 - fix intermittent load events in browser_967000_button_sync.js, r=markh
This commit is contained in:
parent
54e44d4c3b
commit
226bf1e3c6
@ -30,11 +30,16 @@ function openAboutAccountsFromMenuPanel(entryPoint) {
|
|||||||
ok(syncButton, "The Sync button was added to the Panel Menu");
|
ok(syncButton, "The Sync button was added to the Panel Menu");
|
||||||
|
|
||||||
let deferred = Promise.defer();
|
let deferred = Promise.defer();
|
||||||
let handler = () => {
|
let handler = (e) => {
|
||||||
gBrowser.selectedTab.removeEventListener("load", handler, true);
|
if (e.originalTarget != gBrowser.selectedTab.linkedBrowser.contentDocument ||
|
||||||
|
e.target.location.href == "about:blank") {
|
||||||
|
info("Skipping spurious 'load' event for " + e.target.location.href);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
gBrowser.selectedTab.linkedBrowser.removeEventListener("load", handler, true);
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
}
|
}
|
||||||
gBrowser.selectedTab.addEventListener("load", handler, true);
|
gBrowser.selectedTab.linkedBrowser.addEventListener("load", handler, true);
|
||||||
|
|
||||||
syncButton.click();
|
syncButton.click();
|
||||||
yield deferred.promise;
|
yield deferred.promise;
|
||||||
|
Loading…
Reference in New Issue
Block a user