Skip to content

Load firefox extension #803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sridharaiyer opened this issue Feb 5, 2021 · 2 comments
Closed

Load firefox extension #803

sridharaiyer opened this issue Feb 5, 2021 · 2 comments
Labels
enhancement Making things better

Comments

@sridharaiyer
Copy link

I want an ability to do something like this for firefox:

profile = webdriver.FirefoxProfile() profile.add_extension(extension='https_everywhere-2019.1.31-an+fx.xpi') driver = webdriver.Firefox(firefox_profile=profile)
I see that we can use the CLI option --extension-zip=XXX.crx for Chrome, but unfortunuately this extension for my Chromedriver does not work. I have a similar extension for firefox but just Seleniumbase to load it.

@mdmintz
Copy link
Member

mdmintz commented Feb 6, 2021

See https://github.com/seleniumbase/SeleniumBase/releases/tag/v1.55.1
There's a new method for loading a .xpi file:

self.install_addon(xpi_file)

For some reason, it must be done at run-time after the browser has already spun up, unlike Chrome extensions, which must be initialized before the web browser is launched. So, load your Chrome extensions on the command-line, and load your Firefox add-ons inside the tests.

@mdmintz mdmintz added the enhancement Making things better label Feb 6, 2021
@mdmintz mdmintz closed this as completed Feb 6, 2021
@sridharaiyer
Copy link
Author

Thanks a ton! This is super helpful and really appreciate the quick turnaround 👍🏼😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making things better
Projects
None yet
Development

No branches or pull requests

2 participants