add: else { var newTab = gBrowser.addTab(defaultSearchURL); var loadInBackground = pref.getBoolPref("browser.tabs.loadInBackground"); if (reverseBackgroundPref) loadInBackground = !loadInBackground; if (!loadInBackground) gBrowser.selectedTab = newTab; } 
context: function OpenSearch(tabName, searchStr, newWindowFlag){  //This function needs to be split up someday.  var autoOpenSearchPanel = false;  var defaultSearchURL = null;  var fallbackDefaultSearchURL = gNavigatorRegionBundle.getString("fallbackDefaultSearchURL");  ensureSearchPref()  //Check to see if search string contains "://" or "ftp." or white space.  //If it does treat as url and match for pattern    var urlmatch= /(:\/\/|^ftp\.)[^ \S]+$/   var forceAsURL = urlmatch.test(searchStr);  try {    autoOpenSearchPanel = pref.getBoolPref("browser.search.opensidebarsearchpanel");    defaultSearchURL = pref.getComplexValue("browser.search.defaulturl",                                            Components.interfaces.nsIPrefLocalizedString).data;  } catch (ex) {  }  // Fallback to a default url (one that we can get sidebar search results for)  if (!defaultSearchURL)    defaultSearchURL = fallbackDefaultSearchURL;  if (!searchStr) {    BrowserSearchInternet();  } else {    //Check to see if location bar field is a url    //If it is a url go to URL.  A Url is "://" or "." as commented above    //Otherwise search on entry    if (forceAsURL) {       BrowserLoadURL()    } else {      if (searchStr) {        var escapedSearchStr = encodeURIComponent(searchStr);        defaultSearchURL += escapedSearchStr;        var searchDS = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"]                                 .getService(Components.interfaces.nsIInternetSearchService);        searchDS.RememberLastSearchText(escapedSearchStr);        try {          var searchEngineURI = pref.getCharPref("browser.search.defaultengine");          if (searchEngineURI) {                      var searchURL = getSearchUrl("actionButton");            if (searchURL) {              defaultSearchURL = searchURL + escapedSearchStr;             } else {              searchURL = searchDS.GetInternetSearchURL(searchEngineURI, escapedSearchStr, 0, 0, {value:0});              if (searchURL)                defaultSearchURL = searchURL;            }          }        } catch (ex) {        }        if (!newWindowFlag)          loadURI(defaultSearchURL);        else          window.open(defaultSearchURL, "_blank");      }    }  }  // should we try and open up the sidebar to show the "Search Results" panel?  if (autoOpenSearchPanel)    RevealSearchPanel();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/0d6323f0156273e79d527235f9d8347f6a8bddab/navigator.js/clean/xpfe/browser/resources/content/navigator.js