rem: var prefInt =   null; var strDefaultSearchEngineName;  prefInt     =   Components.classes["@mozilla.org/preferences;1"]; if (prefInt) { prefInt = prefInt.getService(Components.interfaces.nsIPref); strDefaultSearchEngineName = prefInt.getLocalizedUnicharPref("browser.search.defaultenginename"); } 
add: var strDefaultSearchEngineName = parent.hPrefWindow.pref.getLocalizedUnicharPref("browser.search.defaultenginename"); 
context: function checkEngine(){  var engineList = document.getElementById("engineList");  var engineValue = engineList.label;    //nothing is selected  if (!engineValue)  {    try    {        var prefInt =   null; //Preferences Interface        var strDefaultSearchEngineName;        prefInt     =   Components.classes["@mozilla.org/preferences;1"];        if (prefInt)         {            prefInt = prefInt.getService(Components.interfaces.nsIPref);            strDefaultSearchEngineName = prefInt.getLocalizedUnicharPref("browser.search.defaultenginename");        }        var engineListSelection = engineList.getElementsByAttribute( "label", strDefaultSearchEngineName );        var selectedItem = engineListSelection.length ? engineListSelection[0] : null;            if (selectedItem)        {            //select a locale-dependent predefined search engine in absence of a user default            engineList.selectedItem = selectedItem;        }        else        {            //select the first listed search engine            engineList.selectedIndex = 1;        }    }    catch(e)    {        //select the first listed search engine        engineList.selectedIndex = 1;    }  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/a19ff86b058da3c272d78e57ba1a6e97c171c6e9/pref-search.js/clean/suite/common/pref/pref-search.js