var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
prefs = prefs.getBranch("network.proxy.");
prefs.setIntPref("type", '1');
prefs.setIntPref("http_port", '3128');
prefs.setCharPref('http', '192.168.1.1')
prefs.setBoolPref('socks_remote_dns', 'true')
//socks将http修改为socks
更多参数:https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Preferences#nsISupportsString
标签:none