mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 1369750 - Get window from event.target.defaultView inside load event to make r=mossop
sure getting the right target window, r?mossop MozReview-Commit-ID: HwHSwvCrXh7 --HG-- extra : rebase_source : 46293d2485b6a019cdcc5b5a9f260058fbdaaf8f
This commit is contained in:
parent
f7de73f89f
commit
4b21f8e958
@ -102,14 +102,20 @@ class Onboarding {
|
||||
}
|
||||
}
|
||||
|
||||
addEventListener("load", function(evt) {
|
||||
addEventListener("load", function onLoad(evt) {
|
||||
if (!content || evt.target != content.document) {
|
||||
return;
|
||||
}
|
||||
removeEventListener("load", onLoad);
|
||||
|
||||
let window = evt.target.defaultView;
|
||||
// Load onboarding module only when we enable it.
|
||||
if ((content.location.href == ABOUT_NEWTAB_URL ||
|
||||
content.location.href == ABOUT_HOME_URL) &&
|
||||
if ((window.location.href == ABOUT_NEWTAB_URL ||
|
||||
window.location.href == ABOUT_HOME_URL) &&
|
||||
Services.prefs.getBoolPref("browser.onboarding.enabled", false)) {
|
||||
|
||||
content.requestIdleCallback(() => {
|
||||
new Onboarding(content);
|
||||
window.requestIdleCallback(() => {
|
||||
new Onboarding(window);
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
|
Loading…
Reference in New Issue
Block a user