rem:  if (cancel.value) window.close(); } 
add:  if (cancel.value) { window.close(); } else { self._processConfig(); } } 
context:   startup : function()  {    this._ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);    this._tld = Cc["@mozilla.org/network/effective-tld-service;1"].getService(Ci.nsIEffectiveTLDService);    var install = false;    if (window.arguments && window.arguments[0]) {      this._profile = new Profile(window.arguments[0].QueryInterface(Ci.nsICommandLine));      install = window.arguments[0].handleFlag("install", false);      if (!install)        install = (this._profile.uri == null);      // Set the windowtype attribute here, so we always know which window is the main window      document.documentElement.setAttribute("windowtype", "webrunner:main");      // Hack to get the mime handler initialized correctly so the content handler dialog doesn't appear      var hs = Cc["@mozilla.org/uriloader/handler-service;1"].getService(Ci.nsIHandlerService);      var extps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].getService(Ci.nsIExternalProtocolService);      // Set the 'http' handler      var httpHandler = extps.getProtocolHandlerInfo("http");      httpHandler.preferredAction = Ci.nsIHandlerInfo.useSystemDefault;      httpHandler.alwaysAskBeforeHandling = false;      hs.store(httpHandler);      // Set the 'https' handler      var httpsHandler = extps.getProtocolHandlerInfo("https");      httpsHandler.preferredAction = Ci.nsIHandlerInfo.useSystemDefault;      httpsHandler.alwaysAskBeforeHandling = false;      hs.store(httpsHandler);    }    else {      var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);      var win = wm.getMostRecentWindow("webrunner:main");      if (win && win.WebRunner) {        this._profile = win.WebRunner._profile;        this._profile.uri = null;      }      else {        this._profile = new Profile(null);      }    }    // Do we need to handle making a web application?    if (install) {      var cancel = {value: true};      window.openDialog("chrome://webrunner/content/install-shortcut.xul", "install", "centerscreen,modal", this._profile, cancel);      // Since we needed to install and the user must have canceled, lets close webrunner      if (cancel.value)        window.close();    }    // Process commandline parameters    document.documentElement.setAttribute("id", this._profile.icon);    document.getElementById("locationbar").hidden = !this._profile.location;    document.getElementById("box_sidebar").hidden = !this._profile.sidebar;    document.getElementById("splitter_sidebar").hidden = !this._profile.sidebar;    if (!this._profile.navigation) {      // Remove navigation key from the document      var keys = document.getElementsByTagName("key");      for (var i=keys.length - 1; i>=0; i--)        if (keys[i].className == "nav")          keys[i].parentNode.removeChild(keys[i]);    }    // Hookup the browser window callbacks    window.QueryInterface(Ci.nsIInterfaceRequestor)          .getInterface(Ci.nsIWebNavigation)          .QueryInterface(Ci.nsIDocShellTreeItem)          .treeOwner          .QueryInterface(Ci.nsIInterfaceRequestor)          .getInterface(Ci.nsIXULWindow)          .XULBrowserWindow = this;    var self = this;    window.addEventListener("close", function(event) { self._handleWindowClose(event); }, false);    var browser = this._getBrowser();    browser.addEventListener("DOMTitleChanged", function(aEvent) { self._domTitleChanged(aEvent); }, true)    browser.addEventListener("dragover", function(aEvent) { self._dragOver(aEvent); }, true)    browser.addEventListener("dragdrop", function(aEvent) { self._dragDrop(aEvent); }, true)    browser.webProgress.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_ALL);    if (this._profile.uri)        browser.loadURI(this._profile.uri, null, null);    document.getElementById("popup_content").addEventListener("popupshowing", self._popupShowing, false);    document.getElementById("tooltip_content").addEventListener("popupshowing", self._tooltipShowing, false);    // Let osx make its app menu, then hide the window menu    var mainMenu = document.getElementById("menu_main");    if (mainMenu) {      mainMenu.hidden = true;      // Needed for linux or the menubar doesn't hide      document.getElementById("menu_file").hidden = true;    }    setTimeout(function() { self._delayedStartup(); }, 0);  },
meta: 2142	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/2142/9acd92adb081f645afc8da9edae2a3f507dde390/webrunner.js/buggy/app/chrome/content/webrunner.js