rem: var prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch); var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); 
add: var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); if (gStartingUp) { gStartingUp = false;  if (ioService.offline) { debug("already offline!"); return; } } 
context:   onProfileStartup: function()  {    debug("onProfileStartup");      var prefs = Components.classes["@mozilla.org/preferences-service;1"].        getService(Components.interfaces.nsIPrefBranch);      var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);      gOfflineStartupMode = prefs.getIntPref(kOfflineStartupPref);    if (gOfflineStartupMode == kRememberLastState)    {      var offline = !prefs.getBoolPref("network.online");      // if the user checked "work offline" in the profile mgr UI      // and forced us offline, remember that in prefs      // if checked, the "work offline" checkbox overrides our       // persisted state      if (ioService.offline)        prefs.setBoolPref("network.online", false);       else       {         // if user did not check "work offline" in the profile manager UI         // use the persisted online state pref to restore our offline state         ioService.offline = offline;       }      var observerService = Components.        classes["@mozilla.org/observer-service;1"].        getService(Components.interfaces.nsIObserverService);      observerService.addObserver(this, "network:offline-status-changed", false);      observerService.addObserver(this, "quit-application", false);      observerService.addObserver(this, "xpcom-shutdown", false);    }    else if (gOfflineStartupMode == kAskForOnlineState)    {      var promptService = Components.        classes["@mozilla.org/embedcomp/prompt-service;1"].        getService(Components.interfaces.nsIPromptService);      var bundle = getBundle(kBundleURI);      if (!bundle)        return;      var title = bundle.GetStringFromName("title");      var desc = bundle.GetStringFromName("desc");      var button0Text = bundle.GetStringFromName("workOnline");      var button1Text = bundle.GetStringFromName("workOffline");      var checkVal = {value:0};      var result = promptService.confirmEx(null, title, desc,        (promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_IS_STRING) +        (promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_IS_STRING),        button0Text, button1Text, null, null, checkVal);      debug ("result = " + result + "\n");      if (result == 1)        ioService.offline = true;    }  },
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/e53548d88532accdc8db4de2497be274c789a350/offlineStartup.js/buggy/mailnews/extensions/offline-startup/js/offlineStartup.js