 gBrowser.addEventListener("pagehide", FeedHandler.onPageHide, false); 
function prepareForStartup(){  gURLBar = document.getElementById("urlbar");  gNavigatorBundle = document.getElementById("bundle_browser");  gProgressMeterPanel = document.getElementById("statusbar-progresspanel");  gFindBar = document.getElementById("FindToolbar");  gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false);  // Note: we need to listen to untrusted events, because the pluginfinder XBL  // binding can't fire trusted ones (runs with page privileges).  gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, true, true);  gBrowser.addEventListener("NewTab", BrowserOpenTab, false);  window.addEventListener("AppCommand", HandleAppCommandEvent, true);  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  // and give C++ access to gBrowser  window.XULBrowserWindow = new nsBrowserStatusHandler();  window.QueryInterface(Ci.nsIInterfaceRequestor)        .getInterface(nsIWebNavigation)        .QueryInterface(Ci.nsIDocShellTreeItem).treeOwner        .QueryInterface(Ci.nsIInterfaceRequestor)        .getInterface(Ci.nsIXULWindow)        .XULBrowserWindow = window.XULBrowserWindow;  window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow =    new nsBrowserAccess();  // 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];      }    }  }  // Initialize browser instance..  appCore.setWebShellWindow(window);  // Manually hook up session and global history for the first browser  // so that we don't have to load global history before bringing up a  // window.  // 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);  var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);  os.addObserver(gBrowser.browsers[0], "browser:purge-session-history", false);  // remove the disablehistory attribute so the browser cleans up, as  // though it had done this work itself  gBrowser.browsers[0].removeAttribute("disablehistory");  // enable global history  gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true;  // hook up UI through progress listener  gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);  // setup our common DOMLinkAdded listener  gBrowser.addEventListener("DOMLinkAdded", DOMLinkHandler, false);  gBrowser.addEventListener("pagehide", FeedHandler.onPageHide, false);}
5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5459/5ec205635eb612638dbb23abe3e751ce1897cf2a/browser.js/clean/browser/base/content/browser.js