From 3c5b7fe1654db0bedbf5550bdd4e3b0d09d407e4 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Sat, 29 Jul 2006 05:41:58 +0000 Subject: [PATCH] Bug 166219 offline load handler fires multiple times r=jag sr=sspitzer --- suite/common/utilityOverlay.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/suite/common/utilityOverlay.js b/suite/common/utilityOverlay.js index ddb8377bbcc2..9280dda69829 100644 --- a/suite/common/utilityOverlay.js +++ b/suite/common/utilityOverlay.js @@ -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);