context: function openNewTabWith(url, sendReferrer, reverseBackgroundPref) {  var browser;  try {    // if we're running in a browser window, this should work    //    browser = getBrowser();  } catch (ex if ex instanceof ReferenceError) {    // must be running somewhere else (eg mailnews message pane); need to    // find a browser window first    //    var windowMediator =      Components.classes["@mozilla.org/appshell/window-mediator;1"]      .getService(Components.interfaces.nsIWindowMediator);    var browserWin = windowMediator.getMostRecentWindow("navigator:browser");    // if there's no existing browser window, then, as long as    // we are allowed to, open this url in one and return    //    if (!browserWin) {      urlSecurityCheck(url, document);      window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no",                         url, null, referrer);      return;    }    // otherwise, get the existing browser object    //    browser = browserWin.getBrowser();  }  // Get the XUL document that the browser is actually contained in.  // This is needed if we are trying to load a URL from a non-navigator  // window such as the JS Console.  var browserDocument = browser.ownerDocument;  urlSecurityCheck(url, browserDocument);  var referrer = sendReferrer ? getReferrer(browserDocument) : null;  // As in openNewWindowWith(), we want to pass the charset of the  // current document over to a new tab.   var wintype = browserDocument.firstChild.getAttribute('windowtype');  var originCharset;  if (wintype == "navigator:browser") {    originCharset = window._content.document.characterSet;  }  // open link in new tab  var tab = browser.addTab(url, referrer, originCharset);   if (pref) {    var loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground");    if (reverseBackgroundPref)      loadInBackground = !loadInBackground;    if (!loadInBackground)      browser.selectedTab = tab;  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/3fa118df400adb06b3dca6d0d4b5b4679bfc13f6/contentAreaUtils.js/buggy/suite/common/contentAreaUtils.js