context: function Startup(){  window.XULBrowserWindow = new nsXULBrowserWindow();  var webNavigation;  try {    // Create the browser instance component.    appCore = Components.classes["@mozilla.org/appshell/component/browser/instance;1"]                        .createInstance(Components.interfaces.nsIBrowserInstance);    if (!appCore)      throw Components.results.NS_ERROR_FAILURE;    webNavigation = getWebNavigation();    if (!webNavigation)      throw Components.results.NS_ERROR_FAILURE;  } catch (e) {    alert("Error creating browser instance");    window.close(); // Give up.  }  _content.appCore= appCore;  // Initialize browser instance..  appCore.setWebShellWindow(window);    // give urlbar focus so it'll be an active editor and d&d will work properly  gURLBar = document.getElementById("urlbar");  gURLBar.focus();  // set the offline/online mode  setOfflineStatus();    debug("Setting content window\n");  appCore.setContentWindow(_content);  // Have browser app core load appropriate initial page.  /* START OF UNNECESSARY CODE */  /* sspitzer: I think this code is unnecessary, but I'll leave it until I prove it */  var startpage;  try {    var handler = Components.classes["@mozilla.org/commandlinehandler/general-startup;1?type=browser"]                            .getService(Components.interfaces.nsICmdLineHandler);    startpage = handler.defaultArgs;  } catch (ex) {    debug("failed, reason: " + ex + "\n");    // we failed to get the start page, load this    startpage = "about:blank";  }  //debug("startpage = " + startpage + "\n");  document.getElementById("args").setAttribute("value", startpage);  /* END OF UNNECESSARY CODE */  appCore.loadInitialPage();  // Add a capturing event listener to the content area  // (rjc note: not the entire window, otherwise we'll get sidebar pane loads too!)  //  so we'll be notified when onloads complete.  var contentArea = document.getElementById("appcontent");  contentArea.addEventListener("load", loadEventHandlers, true);  contentArea.addEventListener("focus", contentAreaFrameFocus, true);  // set default character set if provided  debug("*** Pulling out the charset\n");  if ("arguments" in window && window.arguments.length > 1) {    if (window.arguments[1].indexOf("charset=") != -1) {      var arrayArgComponents = window.arguments[1].split("=");      if (arrayArgComponents) {        //we should "inherit" the charset menu setting in a new window        appCore.SetDocumentCharset(arrayArgComponents[1]);        debug("*** SetDocumentCharset(" + arrayArgComponents[1] + ")\n");      }    }  }  try {    var searchMode = pref.GetIntPref("browser.search.mode");    setBrowserSearchMode(searchMode);  } catch (ex) {  }  // set home button tooltip text  var homePage = getHomePage();  if (homePage)    document.getElementById("home-button").setAttribute("tooltiptext", homePage);  // Check for window.arguments[0]. If present, go to that url.  if ("arguments" in window && window.arguments.length > 0) {    // See if load in progress (loading default page).    if (document.getElementById("navigator-throbber").getAttribute("busy") == "true") {      debug("Stopping load of default initial page\n");      getWebNavigation().stop();    }    debug("Loading page specified via openDialog\n");    loadURI(window.arguments[0]);  }  initConsoleListener();  // Perform default browser checking.  checkForDefaultBrowser();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/ccffe3d0d22a870962c3e124bb2495f56095216c/navigator.js/buggy/suite/browser/navigator.js