I read the doc and some SO posts, gist examples, this should be worked, but it does not work, I have no idea where is bad on the code.
The project is quite simple.
background.js
<code class="language-js">var config = {
mode: "fixed_servers",
rules: {
proxyForHttp: {
scheme: "http",
host: "localhost",
port: 3138
},
}
};
chrome.proxy.settings.set(
{value: config, scope: 'regular'},
function() {}
);
</code>
manifest.json
<code class="language-json">{
"background": {
"scripts": ["background.js"]
},
"browser_action": {
"default_title": "chromeexttmp"
},
"name": "chromeexttmp",
"permissions": [
"tabs",
"proxy",
"<all_urls>",
"unlimitedStorage",
"storage",
"webRequest",
"webRequestBlocking"
],
"version": "0.1",
"manifest_version": 2
}
</code>
Of course, the proxy address localhost:3138 is working perfectly (I can confirm that on curl). Checking IP address on a website such as whatismyip, and the IP has not changed, going to the chrome URL chrome://net-internals/#proxy
, there is no proxy settings showing up, and most strangely, there is no error messages on output/debug console. (if the bg.js has some kind of syntax error or something, at least I want some message or really cannot get what is happening behind..). So, what is wrong with my code?
Disclaimer: I'm new to Codeproject, kindly tell me I was wrong something. Thanks.
What I have tried:
I tried reading the document, searching for some SO posts and gist examples on the internet