Use the proxy API to proxy web requests. There are two different ways you can do this:
- use the
proxy.register()function to register an extended Proxy Auto-Configuration (PAC) file, which implements a policy for proxying web requests.
- use the
proxy.onRequestevent listener to intercept web requests, and return an object that describes whether and how to proxy them.
The advantage of the PAC file approach is that if you already have a PAC file it's relatively easy to use it in the WebExtensions framework.
The advantage of the
proxy.onRequest approach is that the code that implements your proxy policy runs in your extension's background script, so it gets full access to the WebExtension APIs available to your extension (including, for example, access to your extension's
storage and networking APIs like
Apart from this API, extensions can also use the
browserSettings.proxyConfig property to configure global proxy settings.
Google Chrome provides an extension API also called "proxy" which is functionally similar to this API, in that extensions can use it to implement a proxying policy. However, the design of the Chrome API is completely different to this API. Because this API is incompatible with the Chrome
proxy API, this API is only available through the
To use this API you need to have the "proxy" permission.
- Describes a proxy.
Contains information about a web request that the browser is about to make.
- Get and set proxy settings.
- Fired when the system encounters an error running the PAC script or the
- Fired when a web request is about to be made, giving the extension an opportunity to proxy it.
|Chrome||Edge||Firefox||Firefox for Android||Opera|
|No||No||60 *||60 *||No|