add: gBrowser.addEventListener("NewTab", BrowserOpenTab, false); 
context: function prepareForStartup(){  gURLBar = document.getElementById("urlbar");  gNavigatorBundle = document.getElementById("bundle_browser");  gProgressMeterPanel = document.getElementById("statusbar-progresspanel");  gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false);  gBrowser.addEventListener("DOMLinkAdded", livemarkOnLinkAdded, false);  gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, false);  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(nsCI.nsIInterfaceRequestor)        .getInterface(nsIWebNavigation)        .QueryInterface(nsCI.nsIDocShellTreeItem).treeOwner        .QueryInterface(nsCI.nsIInterfaceRequestor)        .getInterface(nsCI.nsIXULWindow)        .XULBrowserWindow = window.XULBrowserWindow;  window.QueryInterface(nsCI.nsIDOMChromeWindow).browserDOMWindow =    new nsBrowserAccess();  window.browserContentListener =    new nsBrowserContentListener(window, gBrowser);  // 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);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/c2bcfea585096d0b7e9824f9e6d1f95f18721c24/browser.js/buggy/browser/base/content/browser.js