rem: if ( !searchStr ) return; 
add: if ((searchMode == 1) || (forceDialogFlag == true)) {  var cwindowManager = Components.classes["component: var iwindowManager = Components.interfaces.nsIWindowMediator; var windowManager  = cwindowManager.QueryInterface(iwindowManager); var searchWindow = windowManager.getMostRecentWindow("search:window"); if (searchWindow) { searchWindow.focus(); if (searchWindow.loadPage)	searchWindow.loadPage(tabName, searchStr); } else { window.openDialog("chrome: } } else { if ((!searchStr) || (searchStr == ""))	return; 
context: function OpenSearch(tabName, forceDialogFlag, searchStr){	var searchMode = 0;	var searchEngineURI = null;	var autoOpenSearchPanel = false;	var defaultSearchURL = null;	try	{		searchMode = pref.GetIntPref("browser.search.powermode");		autoOpenSearchPanel = pref.GetBoolPref("browser.search.opensidebarsearchpanel");		searchEngineURI = pref.CopyCharPref("browser.search.defaultengine");		defaultSearchURL = pref.CopyCharPref("browser.search.defaulturl");	}	catch(ex)	{	}		if ((defaultSearchURL == null) || (defaultSearchURL == ""))	{		// Fallback to a Netscape default (one that we can get sidebar search results for)		defaultSearchURL = "http://search.netscape.com/cgi-bin/search?search=";	}	if ((searchMode == 1) || (forceDialogFlag == true))	{    var windowManager = getService( "component://netscape/rdf/datasource?name=window-mediator", "nsIWindowMediator" );		var searchWindow = windowManager.getMostRecentWindow("search:window");		if (searchWindow)		{			searchWindow.focus();			if (searchWindow.loadPage)	searchWindow.loadPage(tabName, searchStr);		}		else			window.openDialog("chrome://search/content/search.xul", "SearchWindow", "dialog=no,close,chrome,resizable", tabName, searchStr);	}	else	{		if ( !searchStr )       return;    var searchDS = getService( "component://netscape/rdf/datasource?name=internetsearch", "nsIInternetSearchService" );		var	escapedSearchStr = escape(searchStr);		defaultSearchURL += escapedSearchStr;		if (searchDS)		{			searchDS.RememberLastSearchText(escapedSearchStr);			if ((searchEngineURI != null) && (searchEngineURI != ""))			{				try				{					var	searchURL = searchDS.GetInternetSearchURL(searchEngineURI, escapedSearchStr);					if ((searchURL != null) && (searchURL != ""))					{						defaultSearchURL = searchURL;					}				}				catch(ex)				{				}			}		}		window.content.location.href = defaultSearchURL;	}	// should we try and open up the sidebar to show the "Search Results" panel?	if (autoOpenSearchPanel == true)		RevealSearchPanel();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/f5a8a1af2368f6bc7df2ed21b3704dabca8c6809/navigator.js/buggy/suite/browser/navigator.js