Closed Bug 1405975 Opened 7 years ago Closed 7 years ago

[WebExtension] important browser.proxy improvements

Categories

(WebExtensions :: Request Handling, defect)

57 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1396485

People

(Reporter: richard.neomy, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce:

I am porting my Proxy Manager add-on to WebExtensions. There are a few important features that are missing:

1. There should be a way to display the current proxy setting to users. The JPM version gets the proxy config and reflects the applied mode as a color code in the toolbar button (for instance "Red" color for SOCKS server, "Green" for "system" proxy, ...). This is very important as there might be another extension that handles the proxy setting and user needs to be aware of this.

2. It is not possible to set "file://" PAC scripts. Many users use their own PAC script to handle proxy config and currently browser.proxy.register does not accept this scheme. Also there should be a way to convert "string" PAC scripts and use them (like converting them to Data URIs) [My extension has an editor and allow users to write a PAC script].

3. There is no way to allow a user to use either "system" or "auto detect" modes with the current PAC script implementation. So let's say a user has a global PAC script installed on the OS level. How can we ask Firefox to use that proxy?
3. Bug 1319630.
Component: Untriaged → WebExtensions: Frontend
Product: Firefox → Toolkit
Component: WebExtensions: Frontend → WebExtensions: Request Handling
> There should be a way to display the current proxy setting to users.

You can do this in your addon by changing the browserAction icon

> It is not possible to set "file://" PAC scripts.

bug 1396485

> Also there should be a way to convert "string" PAC scripts and use them (like converting them to Data URIs)

You can already read the PAC script using XHR and get the content as a string that way.

> There is no way to allow a user to use either "system" or "auto detect"

bug 1319630 and bug 1319631
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
> You can do this in your addon by changing the browserAction icon

I didn't mean to read my own configured proxy settings. I meant to read the actual proxy configs that Firefox is currently using considering more than one extension is controlling the proxy settings. Also user might have manually changed the proxy settings from the FF options

> You can already read the PAC script using XHR and get the content as a string that way.

I meant to allow users to writ PAC scripts in a text box and use that code as the PAC script that Firefox is using
> I meant to allow users to writ PAC scripts in a text box and use that code as the PAC script that Firefox is using

You can already do that. Pass the PAC script entered by the user to your addon's FindProxyForURL() implementation and use eval() there. If you want to host the addon on addons.mozilla.org, you'll need to get the policy changed to allow for eval() in PAC files: https://wiki.mozilla.org/Add-ons/Reviewers/Guide/Reviewing#Policies_and_Actions_2

This has been discussed at length on the amo-admins mailing list. No one is opposed to it but a formal policy change hasn't happened yet.

> I meant to read the actual proxy configs that Firefox is currently using considering more than one extension is controlling the
> proxy settings.

If there are addons installed using the proxyAPI, then each URL may be using different proxy settings. There's no way for other addons to know if a proxy was used short of something bug 1388289 (assuming the proxy uses auth). Maybe there is another webRequest callback which exposes if a URL was loaded through a proxy.

> Also user might have manually changed the proxy settings from the FF options

Still don't know of a way to read that from WebExtensions. You could file a new bug for it if that's something you want, but it would be of limited value since proxyAPI addons effectively override those settings.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.