proxy.settings 编辑
A BrowserSetting
object that can be used to change the browser's proxy settings.
Note: The ability to change proxy settings requires private window access because proxy settings affect both private and non-private windows. Therefore, if an extension has not been granted private window permission, calls to proxy.settings.set()
will 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.
autoConfigUrl
Optionalstring
. A URL to use to configure the proxy.autoLogin
Optionalboolean
. Do not prompt for authentication if the password is saved. Defaults tofalse
.ftp
Optionalstring
. The address of the FTP proxy. Can include a port.http
Optionalstring
. The address of the HTTP proxy. Can include a port.httpProxyAll
Optionalboolean
. Use the HTTP proxy server for all protocols. Defaults tofalse
.passthrough
Optionalstring
. A comma-separated list of hosts which should not be proxied. Defaults to "localhost, 127.0.0.1".proxyDNS
Optionalboolean
. Proxy DNS when using SOCKS5. Defaults tofalse
.proxyType
Optionalstring
. The type of proxy to use. This may take any one of the following values: "none", "autoDetect", "system", "manual", "autoConfig". Defaults to "system".socks
Optionalstring
. The address of the SOCKS proxy. Can include a port.socksVersion
Optionalinteger
. The version of the SOCKS proxy. May be 4 or 5. Defaults to 5.ssl
Optionalstring
. 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
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论