如何将修改标头添加到 fifrefox 配置文件并在用户代理中运行测试值:Mozilla/5.0(iPhone;U;CPU iPhone OS 4_0,如 Mac OS X;en-us)AppleWebKit/532.9(KHTML,如 Gecko)移动/7D11。为此,我使用了以下代码 fp 是 firefox
profile object fp.setEnableNativeEvents(true);
File file = new File("C:\\FirefoxProfile\\modify_headers-0.7.1.1-fx.xpi");
//File file = new File("C:\\AddOn");
fp.addExtension(file);
fp.setPreference("extensions.modify_headers.currentVersion", "0.7.1.1-fx");
fp.setPreference("modifyheaders.config.alwaysOn", true);
fp.setPreference("modifyheaders.headers.count", 2);
fp.setPreference("modifyheaders.headers.action1", "Modify");
fp.setPreference("modifyheaders.headers.name0", "User-Agent");
fp.setPreference("modifyheaders.headers.value0", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Mobile/7D11");
fp.setPreference("modifyheaders.headers.enabled0", true);