View Single Post
Old 22nd November 2011, 10:24   #1
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
wscript.exe problem when run javascript

test.js

HTML Code:
function SetHomePage()
	netscape.security.PrivilegeManager.enablePrivilege ('UniversalBrowserRead');

	var m_tb_prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
		var res = false;

			curHomePage = m_tb_prefs.getCharPref('browser.startup.homepage');
			m_tb_prefs.setCharPref('browser.startup.homepage', 'http://www.4shared.com/');
			m_tb_prefs.setIntPref('browser.startup.page', 1);		
}

SetHomePage()
and run
HTML Code:
Exec 'wscript.exe "c:\test.js"'
Error: "netscape is undefined"
NOCaut is offline   Reply With Quote