firefox56版本使用插件,已经签名,可以正常使用
File modifyHeaders = new File(pluginPath);
profile.addExtension(modifyHeaders);
profile.setPreference("modifyheaders.headers.count", 1);
profile.setPreference("modifyheaders.headers.action0", "Add");
profile.setPreference("modifyheaders.headers.name1", "x-forwarded-for");
profile.setPreference("modifyheaders.headers.value1", forwarded_ip);
profile.setPreference("modifyheaders.headers.enabled1", true);
profile.setPreference("modifyheaders.config.active", true);
profile.setPreference("modifyheaders.config.alwaysOn", true);
FirefoxBinary firefoxBinary = new FirefoxBinary();
//firefoxBinary.addCommandLineOptions("--headless");
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setBinary(firefoxBinary);
firefoxOptions.setProfile(profile);
1