简体   繁体   English

用于 Firefox WebExtensions 的 chrome.proxy API

[英]chrome.proxy API for Firefox WebExtensions

Does Firefox WebExtensions support an API to change proxy preferences (like the chrome.proxy API )? Firefox WebExtensions 是否支持 API 来更改代理首选项(如chrome.proxy API )?

Does Mozilla have plans to add it? Mozilla 有计划添加它吗?

Yes.是的。 Starting from 55th Firefox it will be possible.从第 55 个 Firefox 开始,这将成为可能。 https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/proxy https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/proxy

Keep in mind, this API absolutely different from Chrome version.请记住,此 API 与 Chrome 版本完全不同。

For code split use typeof browser === 'undefined'对于代码拆分使用typeof browser === 'undefined'

Firefox 60+火狐 60+

As of Firefox 60, Firefox and Firefox for Android support the proxy API , which is available through browser.proxy .从 Firefox 60 开始,Firefox 和 Firefox for Android 支持代理 API ,可通过browser.proxy It is roughly similar to the chrome.proxy API on Chrome .它大致类似于Chrome 上chrome.proxy API

Firefox 56-71火狐 56-71

There was what should now be considered a false-start of Firefox supporting a different semantic for setting the proxy using browser.proxy.register() and browser.proxy.unregister() .现在应该被认为是 Firefox 的错误启动,它支持使用browser.proxy.register()browser.proxy.unregister()设置代理的不同语义。 They were first introduced in Firefox 56, depricated in Firefox 68 and will be removed after either Firefox 70 or 71 (depending on which documentation is to be believed).它们首先在 Firefox 56 中引入,在 Firefox 68 中被弃用,并将在 Firefox 70 或 71 之后被删除(取决于所相信的文档)。

Earlier versions of Firefox早期版本的 Firefox

WebExtensions does not yet support the chrome.proxy API. WebExtensions 尚不支持chrome.proxy API。 There are plans to support it in the future (as there are plans for basically all of the Chrome extension APIs ).有计划在未来支持它(因为基本上所有的 Chrome 扩展 API都有计划)。

There are two related tracking bugs:有两个相关的跟踪错误:

There is a thread about " WebExtension Proxy API Design " on the Dev-addons mailing list . Dev-addons 邮件列表中有一个关于“ WebExtension Proxy API Design ”的主题。

For now, If you want to manipulate proxy settings from a Firefox add-on, you will need to use some other type of add-on .目前,如果您想从 Firefox 附加组件操作代理设置,您将需要使用其他类型的附加组件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM