Skip to content
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

Can't run firefox in private mode. #3390

Closed
berdt opened this issue Jan 19, 2017 · 4 comments
Closed

Can't run firefox in private mode. #3390

berdt opened this issue Jan 19, 2017 · 4 comments

Comments

@berdt
Copy link

berdt commented Jan 19, 2017

OS:
w10
Selenium Version:
3.0.2 - python 3.6
Browser:
Firefox 50.0
Geckodriver:
0.13

Neither using

profile = webdriver.FirefoxProfile()
profile.set_preference("browser.privatebrowsing.autostart", True)
dr = webdriver.Firefox(profile)

OR

b = FirefoxBinary(r"C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
b.add_command_line_options("-private")
ff = webdriver.Firefox(profile, firefox_binary=r"C:\Program Files (x86)\Mozilla Firefox\firefox.exe")

the browser will be running in private mode.

@davehunt
Copy link
Contributor

Try this, it worked for me:

from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
o = Options()
o.add_argument('-private')
f = Firefox(firefox_options=o)

@rlora
Copy link

rlora commented Feb 24, 2017

@berdt were you able to achieve this?
I'm experiencing something similar, however when I inspect the properties (about:config) private browsing autostart is ON. So the flag seems to be working although FF doesn't seem to be in private mode.

I'm using FF 51, node webdriver 3.1.0, geckodriver 0.14, MacOS Sierra.
In this version I can't add arguments as @davehunt suggests. I can do it for Chrome but the FF Options instance does not have the addArgument method. Only setProfile, so I guess it has to be done through the profile.

Let me know if you got it working.

Thanks!

@berdt
Copy link
Author

berdt commented Feb 24, 2017

@rlora I have not tried, decided to downgrade to an earlier version of Firefox and selenium.

@barancev
Copy link
Member

barancev commented Aug 2, 2017

@barancev barancev closed this as completed Aug 2, 2017
@lock lock bot locked and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants