proxy.settings
A BrowserSetting object that can be used to change the browser's proxy settings.
Note: Changing proxy settings requires private browsing window access because proxy settings affect private and non-private windows. Whether an extension can access private browsing windows is under user control. For details, see Extensions in Private Browsing. Your extension can check whether it can access private browsing windows using extension.isAllowedIncognitoAccess. If your extension does not have private window permission, calls to proxy.settings.set() throw an exception.
The underlying value is an object with the properties listed below.
When setting this object, all properties are optional. Note that any properties that are omitted will be reset to their default value.
-
autoConfigUrlOptional -
string. A URL to use to configure the proxy. -
autoLoginOptional -
boolean. Do not prompt for authentication if the password is saved. Defaults tofalse. -
ftpOptional Deprecated -
string. The address of the FTP proxy. Can include a port. -
httpOptional -
string. The address of the HTTP proxy. Can include a port. -
httpProxyAllOptional -
boolean. Use the HTTP proxy server for all protocols. Defaults tofalse. -
passthroughOptional -
string. A comma-separated list of hosts which should not be proxied. Defaults to "localhost, 127.0.0.1". -
proxyDNSOptional -
boolean. Proxy DNS when using SOCKS5. Defaults tofalse. -
proxyTypeOptional -
string. The type of proxy to use. This may take any one of the following values: "none", "autoDetect", "system", "manual", "autoConfig". Defaults to "system". -
socksOptional -
string. The address of the SOCKS proxy. Can include a port. -
socksVersionOptional -
integer. The version of the SOCKS proxy. May be 4 or 5. Defaults to 5. -
sslOptional -
string. The address of the SSL proxy. Can include a port.
Examples
let proxySettings = { proxyType: "manual", http: "http://proxy.org:8080", socksVersion: 4, passthrough: ".example.org" }; browser.proxy.settings.set({value: proxySettings});
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
settings |
No | No | 60From version 88, theftp setting has no effect because FTP is no longer supported (see bug 1626365). |
? | No | No | ? | ? | No | ? | No | ? |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/settings