rem: if (searchEngineURI) { 
add: if (searchEngineURI) { 
context: function OpenSearch(tabName, searchStr, newTabFlag){  //This function needs to be split up someday.  //XXXnoririty I don't want any prefs switching open by tabs to window  //XXXpch: this routine needs to be cleaned up.  var defaultSearchURL = null;  var navigatorRegionBundle = document.getElementById("bundle_browser_region");  var fallbackDefaultSearchURL = navigatorRegionBundle.getString("fallbackDefaultSearchURL");  //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 {    defaultSearchURL = gPrefService.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(null, null)    } 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 = gPrefService.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 (!newTabFlag) {          loadURI(defaultSearchURL, null, null);        }        else {          var newTab = getBrowser().addTab(defaultSearchURL);          if (!gPrefService.getBoolPref("browser.tabs.loadInBackground"))            getBrowser().selectedTab = newTab;        }      }    }  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/2fb9feaadc992e3ccd442db789244b253d0427f8/browser.js/buggy/browser/base/content/browser.js