proxy

Use the proxy API to proxy web requests. You can use the proxy.onRequest event listener to intercept web requests, and return an object that describes whether and how to proxy them.

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 dns).

Apart from this API, extensions can also use the browserSettings.proxyConfig property to configure global proxy settings.

Note: Chrome, Edge, and Opera have 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 browser namespace.

To use this API you need to have the "proxy" permission. Also, where you want to intercept requests, you also need host permission for the URLs of intercepted requests.

The "proxy" permission requires "strict_min_version" to be set to "91.1.0" or above. To use this permission, add or update the "browser_specific_settings" key in your manifest.json to specify a minimum Firefox version. See Securing the proxy API for Firefox add-ons for more information.

Note: The browser can make speculative connections, where it determines that a request to a URI may be coming soon. This type of connection does not provide valid tab information, so request details such as tabId, frameId, parentFrameId, etc. are inaccurate. These connections have a webRequest.ResourceType of speculative.

Types

proxy.ProxyInfo

Describes a proxy.

proxy.RequestDetails

Contains information about a web request that the browser is about to make.

Properties

proxy.settings

Get and set proxy settings.

Events

proxy.onError

Fired when the system encounters an error running the PAC script or the onRequest listener.

proxy.onRequest

Fired when a web request is about to be made, giving the extension an opportunity to proxy it.

Example extensions

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
proxy
Chrome – No support
Chrome
footnote
footnote The proxy namespace exists, but the behavior does not match the MDN documentation. See Chrome's proxy documentation instead.
Edge – No support
Edge
footnote
footnote The proxy namespace exists, but the behavior does not match the MDN documentation. See Edge's proxy documentation instead.
Firefox – Full support
Firefox 55 (Release date: 2017-08-08)
footnote Full support
Opera – No support
Opera
footnote
footnote The proxy namespace exists, but the behavior does not match the MDN documentation. See Opera's proxy documentation instead.
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 55 (Release date: 2017-08-08)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
ProxyInfo
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
ProxyInfo.masqueTemplate
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 146 (Release date: 2025-12-09)
footnote
footnote Was available as pathTemplate in Firefox 145.
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 146 (Release date: 2025-12-09)
footnote
footnote Was available as pathTemplate in Firefox for Android 145.
Safari on iOS – No support
Safari on iOS
footnote No support
ProxyInfo.proxyAuthorizationHeader
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote
footnote Support for HTTP proxies (in addition to HTTPS proxies) added in Firefox 125.
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote
footnote Support for HTTP proxies (in addition to HTTPS proxies) added in Firefox for Android 125.
Safari on iOS – No support
Safari on iOS
footnote No support
ProxyInfo.type
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote
footnote Support for the "masque" type was added in Firefox 145.
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote
footnote Support for the "masque" type was added in Firefox for Android 145.
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.cookieStoreId
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.documentUrl
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.frameId
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.fromCache
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.incognito
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.method
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.originUrl
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.parentFrameId
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.requestHeaders
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.requestId
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.tabId
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.thirdParty
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.timeStamp
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.type
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
RequestDetails.url
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
onError
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – No support
Firefox 55 – 70 (Release date: 2017-08-08)
altname
footnote Removed in 71 and later
altname Alternate name: onProxyError
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 55 (Release date: 2017-08-08)
altname
altname Alternate name: onProxyError
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
onRequest
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote
footnote Before version 78, the tabId and windowId filter properties are ignored.
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 60 (Release date: 2018-05-09)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
settings
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 60 (Release date: 2018-05-09)
footnote
footnote From version 88, the ftp setting has no effect because FTP is no longer supported (see bug 1626365).
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote
footnote The object is defined but any attempt to read or modify the setting throws an exception.
footnote See bug 1725981
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.
Uses a non-standard name
Has more compatibility info.