rem: var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"].createInstance(Components.interfaces.nsISupportsPRBool); ObserverService.notifyObservers(cancelQuit, "quit-application-requested", null);   if (cancelQuit.data) return; } catch (ex) {  } }  
add: if (!canQuitApplication()) return;  
context: function goQuitApplication(){  var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService();  ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService);  if (ObserverService)  {    try    {      var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"].createInstance(Components.interfaces.nsISupportsPRBool);      ObserverService.notifyObservers(cancelQuit, "quit-application-requested", null);            // Something aborted the quit process.       if (cancelQuit.data)        return;    }    catch (ex)    {      // dump("no observer found \n");    }  }  var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();  var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);  var enumerator = windowManagerInterface.getEnumerator( null );  var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService();  appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService );  var nativeAppSupport = null;  try {    nativeAppSupport = appShell.nativeAppSupport;  }  catch ( ex ) {  }  while ( enumerator.hasMoreElements()  )  {     var domWindow = enumerator.getNext();     if (("tryToClose" in domWindow) && !domWindow.tryToClose())       return false;               domWindow.close();  };  if (!nativeAppSupport || !nativeAppSupport.isServerMode)    appShell.quit(Components.interfaces.nsIAppShellService.eAttemptQuit);  return true;}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/5ccac856fea874dc50033b3af8423062c5d76a9b/globalOverlay.js/clean/toolkit/content/globalOverlay.js