rem: debug("Search defaultSearchURL: " + defaultSearchURL + "\n");  
context: function OpenSearch(tabName, forceDialogFlag, searchStr){  var searchMode = 0;  var searchEngineURI = null;  var autoOpenSearchPanel = false;  var defaultSearchURL = null;  var fallbackDefaultSearchURL = bundle.GetStringFromName("fallbackDefaultSearchURL");  var otherSearchURL = bundle.GetStringFromName("otherSearchURL");  // XXX This somehow causes a big leak, back to the old way  //     till we figure out why. See bug 61886.  // var url = getWebNavigation().currentURI.spec;  var url = _content.location.href;  try {    searchMode = pref.GetIntPref("browser.search.powermode");    autoOpenSearchPanel = pref.GetBoolPref("browser.search.opensidebarsearchpanel");    searchEngineURI = pref.CopyCharPref("browser.search.defaultengine");    defaultSearchURL = pref.getLocalizedUnicharPref("browser.search.defaulturl");  } catch (ex) {  }  debug("Search defaultSearchURL: " + defaultSearchURL + "\n");  // Fallback to a Netscape default (one that we can get sidebar search results for)  if (!defaultSearchURL)    defaultSearchURL = fallbackDefaultSearchURL;  debug("This is before the search " + url + "\n");  debug("This is before the search " + searchStr + "\n");  if (!searchStr || searchStr == url) {    if (defaultSearchURL != fallbackDefaultSearchURL)      loadURI(defaultSearchURL);    else      loadURI(otherSearchURL);  } else {    if (forceDialogFlag || searchMode == 1) {      // Use a single search dialog      var windowManager = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]                                    .getService(Components.interfaces.nsIWindowMediator);      var searchWindow = windowManager.getMostRecentWindow("search:window");      if (!searchWindow) {        openDialog("chrome://communicator/content/search/search.xul", "SearchWindow", "dialog=no,close,chrome,resizable", tabName, searchStr);      } else {        // Already had one, focus it and load the page        searchWindow.focus();        if ("loadPage" in searchWindow)          searchWindow.loadPage(tabName, searchStr);      }    } else {      if (searchStr) {        var escapedSearchStr = escape(searchStr);        defaultSearchURL += escapedSearchStr;        var searchDS = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"]                                 .getService(Components.interfaces.nsIInternetSearchService);        searchDS.RememberLastSearchText(escapedSearchStr);        if (searchEngineURI) {          try {            var searchURL = searchDS.GetInternetSearchURL(searchEngineURI, escapedSearchStr);            if (searchURL)              defaultSearchURL = searchURL;          } catch (ex) {          }        }        loadURI(defaultSearchURL);      }    }  }  // should we try and open up the sidebar to show the "Search Results" panel?  if (autoOpenSearchPanel)    RevealSearchPanel();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/fbf522f0101d528fad9181fff4f7d75b482dd8d2/navigator.js/buggy/xpfe/browser/resources/content/navigator.js