add: }  
context: function Startup(){  // init globals  gNavigatorBundle = document.getElementById("bundle_browser");  gBrandBundle = document.getElementById("bundle_brand");  gBrowser = document.getElementById("content");  gURLBar = document.getElementById("urlbar");    var toolbar = document.getElementById("nav-bar");  toolbar.toolbarChanged = BrowserToolbarChanged;  SetPageProxyState("invalid", null);  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 "couldn't create a browser instance";    webNavigation = getWebNavigation();    if (!webNavigation)      throw "no XBL binding for browser";  } catch (e) {    alert("Error launching browser window:" + e);    window.close(); // Give up.    return;  }  // initialize observers and listeners  window.XULBrowserWindow = new nsBrowserStatusHandler();  window.browserContentListener =    new nsBrowserContentListener(window, gBrowser);  // Initialize browser instance..  appCore.setWebShellWindow(window);  gBrowser.addEventListener("load", loadEventHandlers, false);  // set default character set if provided  if ("arguments" in window && window.arguments.length > 1 && window.arguments[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        getMarkupDocumentViewer().defaultCharacterSet = arrayArgComponents[1];      }    }  }  //initConsoleListener();  // XXXjag work-around for bug 113076  // there's another bug where we throw an exception when getting  // sessionHistory if it is null, which I'm exploiting here to  // detect the situation described in bug 113076.  // The same problem caused bug 139522, also worked around below.  try {    gBrowser.sessionHistory;  } catch (e) {    // sessionHistory wasn't set from the browser's constructor    // so we'll just have to set it here.     // Wire up session and global history before any possible    // progress notifications for back/forward button updating    webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"]                                             .createInstance(Components.interfaces.nsISHistory);    // wire up global history.  the same applies here.    var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"]                                  .getService(Components.interfaces.nsIGlobalHistory);    gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).globalHistory = globalHistory;    const selectedBrowser = gBrowser.selectedBrowser;    if (selectedBrowser.securityUI)      selectedBrowser.securityUI.init(selectedBrowser.contentWindow);  }  // hook up UI through progress listener  gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);  // load appropriate initial page from commandline  var isPageCycling = false;  // page cycling for tinderbox tests  if (!appCore.cmdLineURLUsed)    isPageCycling = appCore.startPageCycler();  // only load url passed in when we're not page cycling  if (!isPageCycling) {    var uriToLoad;    // Check for window.arguments[0]. If present, use that for uriToLoad.    if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0])      uriToLoad = window.arguments[0];        if (uriToLoad && uriToLoad != "about:blank") {      gURLBar.value = uriToLoad;      if ("arguments" in window && window.arguments.length >= 3) {        loadURI(uriToLoad, window.arguments[2]);      } else {        loadURI(uriToLoad);      }    }    // hook up remote support    if (XREMOTESERVICE_CONTRACTID in Components.classes) {      var remoteService;      remoteService = Components.classes[XREMOTESERVICE_CONTRACTID]                                .getService(Components.interfaces.nsIXRemoteService);      remoteService.addBrowserInstance(window);      RegisterTabOpenObserver();    }  }    if (window.opener) {    var openerSidebarBox = window.opener.document.getElementById("sidebar-box");    if (!openerSidebarBox.hidden) {      gMustLoadSidebar = true;      var sidebarBox = document.getElementById("sidebar-box");      sidebarBox.hidden = false;      var sidebarSplitter = document.getElementById("sidebar-splitter");      sidebarSplitter.hidden = false;      var sidebarTitle = document.getElementById("sidebar-title");      sidebarTitle.setAttribute("value", window.opener.document.getElementById("sidebar-title").getAttribute("value"));      sidebarBox.setAttribute("width", openerSidebarBox.boxObject.width);      var sidebarButton = openerSidebarBox.getAttribute("button");      document.getElementById(sidebarButton).checked = true;      sidebarBox.setAttribute("button", sidebarButton);    }  }    // called when we go into full screen, even if it is   // initiated by a web page script  addEventListener("fullscreen", onFullScreen, false);  // does clicking on the urlbar select its contents?  if (navigator.platform.indexOf("Win") == -1)    gClickSelectsAll = false;  // Focus the content area unless we're loading a blank page  var elt;  if (uriToLoad == "about:blank" && !toolbar.hidden && window.locationbar.visible)    elt = gURLBar;  else    elt = _content;  setTimeout(delayedStartup, 0, elt);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/0e799dbef1ba9916e073356644a74553011eb9d3/browser.js/clean/browser/base/content/browser.js