Bug 166219 offline load handler fires multiple times r=jag sr=sspitzer

This commit is contained in:
neil%parkwaycc.co.uk 2003-03-14 09:23:14 +00:00
Родитель 2767b9fdc5
Коммит ef39d70e53
1 изменённых файлов: 2 добавлений и 8 удалений

Просмотреть файл

@ -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);