Click here to Skip to main content
15,945,119 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900