rem: var windowManager = Components.classes['component: 
add: var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); 
context:  function SetPrefToCurrentPage(prefID) { 	dump("SetPrefToCurrentPage("+ prefID +") \n ");	if ((prefID == null) || (prefID == "")) return;	 	var windowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService();	var	windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);    	var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" );	if ( topWindowOfType )	{		var inputfield = document.getElementById(prefID);		dump( "window found "+inputfield+"\n");		if ( inputfield )		{			dump("setting home page to "+topWindowOfType._content.location.href+"\n");			inputfield.value = topWindowOfType._content.location.href;		}	}	else	{		dump(" No browser window. Should be disabling this button \n");	} }
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/0257791053c2b38e1dfaf2ee11afae973e82e394/PrefsWindow.js/clean/xpfe/components/prefwindow/resources/content/PrefsWindow.js