mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
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:
parent
c3a6abad27
commit
1ef5637421
@ -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);
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user