0

I'm trying to use a custom profile in Firefox with an add-on, I can open the profile, launch URL, I even see the add-on icon on top bar but is always set into the disabled mode, I need to set it to active all time. The add-on is 'anonymous' below is what I did, but no success.

public class SeleniumScript {
    static WebDriver driver;
    public static void main(String args[]) throws Exception {
System.setProperty("webdriver.gecko.driver", "E:\\Library\\geckodriver-v0.21.0-win32\\geckodriver.exe");
            ProfilesIni profile2 = new ProfilesIni();
            FirefoxProfile profile3 = profile2.getProfile("AutoProfile");
            FirefoxOptions firefoxOptions = new FirefoxOptions();
            firefoxOptions.setProfile(profile3);
            File file = new File("C:\\Users\\xxx\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\vjo848oc.AutoProfile\\extensions\\client@anonymox.net.xpi");
            profile3.addExtension(file);
            profile3.setPreference("extensions.anonymox.currentVersion", "4.1"); 
            driver = new FirefoxDriver(firefoxOptions);
            String baseURL = "http://abc.com";
            driver.get(baseURL);
            driver.manage().window().maximize();
            }
    }
0

From firefox version 57 and above, only extensions built using WebExtensions APIs will work. You are using an xpi based add-on, that might be the reason of your issue. Please go thru the below link; might help!

https://support.mozilla.org/en-US/kb/find-and-install-add-ons-add-features-to-firefox#w_what-types-of-add-ons-can-i-install

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.