Bug 956724 - Fix broken onload handler for DOMWindows r=rnewman

From fdb5e3aab7479a9cf0ff7b78dcd373e296707e56 Mon Sep 17 00:00:00 2001
This commit is contained in:
Tim Taubert 2014-01-06 16:23:40 +01:00
parent 9e6ed1c053
commit 63400d0e78

View File

@ -304,12 +304,14 @@ TabTracker.prototype = {
switch (topic) {
case "domwindowopened":
// Add tab listeners now that a window has opened.
subject.addEventListener("load", (event) => {
let onLoad = () => {
subject.removeEventListener("load", onLoad, false);
// Only register after the window is done loading to avoid unloads.
this._registerListenersForWindow(subject);
}, false);
};
// Add tab listeners now that a window has opened.
subject.addEventListener("load", onLoad, false);
break;
}
},