Bug 545487 - Cleanup TabTracker_observe [r=Mardak]

Remove the "load" event listener and don't QI since we don't need to.
This commit is contained in:
Paul O’Shannessy 2010-02-11 15:08:28 -08:00
parent c3a6abad27
commit 1ef5637421

View File

@ -253,12 +253,12 @@ TabTracker.prototype = {
observe: function TabTracker_observe(aSubject, aTopic, aData) {
// Add tab listeners now that a window has opened
let window = aSubject.QueryInterface(Ci.nsIDOMWindow);
if (aTopic == "domwindowopened") {
let self = this;
window.addEventListener("load", function() {
aSubject.addEventListener("load", function onLoad(event) {
aSubject.removeEventListener("load", onLoad, false);
// Only register after the window is done loading to avoid unloads
self._registerListenersForWindow(window);
self._registerListenersForWindow(aSubject);
}, false);
}
},