зеркало из https://github.com/mozilla/pjs.git
Bug 166219 offline load handler fires multiple times r=jag sr=sspitzer
This commit is contained in:
Родитель
2767b9fdc5
Коммит
ef39d70e53
|
@ -393,15 +393,9 @@ function utilityOnLoad(aEvent)
|
|||
var observerService = Components.classes[kObserverServiceProgID]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
|
||||
// crude way to prevent registering twice.
|
||||
try {
|
||||
observerService.removeObserver(offlineObserver, "network:offline-status-changed");
|
||||
}
|
||||
catch (ex) {
|
||||
}
|
||||
observerService.addObserver(offlineObserver, "network:offline-status-changed", false);
|
||||
// make sure we remove this observer later
|
||||
addEventListener("unload",utilityOnUnload,false);
|
||||
addEventListener("unload", utilityOnUnload, false);
|
||||
|
||||
// set the initial state
|
||||
var ioService = Components.classes[kIOServiceProgID]
|
||||
|
@ -416,4 +410,4 @@ function utilityOnUnload(aEvent)
|
|||
observerService.removeObserver(offlineObserver, "network:offline-status-changed");
|
||||
}
|
||||
|
||||
addEventListener("load",utilityOnLoad,true);
|
||||
addEventListener("load", utilityOnLoad, false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче