Open Bug 1729315 Opened 3 years ago Updated 2 years ago

From Firefox 91 can't programmatically allow extension for private browsing in testing environment with WebDriver.

Categories

(WebExtensions :: Request Handling, defect, P3)

Firefox 91
defect

Tracking

(Not tracked)

People

(Reporter: hexboris, Unassigned)

References

(Depends on 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

I have web extension that uses browser.proxy.settings.set API but that requires permission to allow extension access to private windows.
Extension is part of our testing environment and need to be installed through WebDriver.
Until recently we used extensions.allowPrivateBrowsingByDefault setting in browser to enable this. From Firefox 91 that setting is removed.

I think it's best to add parameter to Marionette /moz/addon/install command that enables private browsing access for that extension.

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Product: Firefox → WebExtensions

I think it's best to add parameter to Marionette /moz/addon/install command that enables private browsing access for that extension.

This. Or an alternative is to add a (test-only?) option to allow extensions to set proxy settings even if private browsing permission is not granted.

Status: UNCONFIRMED → NEW
Component: Untriaged → Request Handling
Depends on: 1526299
Ever confirmed: true
See Also: → 1525447

Yea that is also an option......

Linking for visibility; this bug was filed as a follow-up to https://bugzilla.mozilla.org/show_bug.cgi?id=1661517#c18 .

Side note: as a temporary work-around you could also set the proxy settings via the prefs directly (network.proxy.* prefs).

Severity: -- → S3
Priority: -- → P3
See Also: → 1661517

Thanks for tip, that's what we use now. But that requires browser restart to change value, right?

(In reply to Boris Prpic from comment #5)

Thanks for tip, that's what we use now. But that requires browser restart to change value, right?

Since WebDriver sets the prefs upfront by generating the browser profile, yes, you'll need to restart.

If the values are dynamic, you could also register a PAC script via prefs instead of a single proxy config.

It's also kinda problematic if you want to test your extension behaviour in Private Browsing, not only because of proxies.

tl;dr the need to install an extension with private browsing permissions via automation is here. (it's not about proxy in our case, it's about the corner case of Firefox Private browsing that are not even a problem on the other platform)

We encountered the same issue when we provide a containerized runtime with a browser extension to customer, which can execute scripts and set proxy. When we set this preference 'browser.privatebrowsing.autostart': true, through WebDriver, we can not start browser extension. Without it, we can not set proxy programmatically. Any workaround for it? Thanks!

You need to log in before you can comment on or make changes to this bug.