I've created a Firefox web extension through which I'm trying to change the proxy settings using web extension API. The issue here is proxyConfig
is expecting the value of http
or any other type to be of the form http://proxy_address:port
and is saving the proxy details with http://
which is a problem as the browser is storing this http://
in place of proxy_address
or ip
. I want to store the proxy without this http://
prefix. Also, if I remove the http://
in http
settings the browser is not storing the proxy as expected.
var proxySettings = {
proxyType: "manual",
http: "proxy_address:proxy_port"
};
browser.browserSettings.proxyConfig.set({value: proxySettings});
Apparently, this is a bug in firefox WebExtensions API, this has been fixed in latest Firefox 60.0 build. The API call/namespace to change the proxy has also changed which needs to be updated in the docs.
var proxySettings = {
proxyType: "manual",
http: "http://proxy_address:proxy_port"
};
browser.proxy.settings.set({value:proxySettings});
Please find the bug report here.