| var config = { | |
| mode: "fixed_servers", | |
| rules: { | |
| singleProxy: { | |
| scheme: "http", | |
| host: "{{ proxy_host }}", | |
| port: parseInt("{{ proxy_port }}") | |
| }, | |
| bypassList: ["localhost"] | |
| } | |
| }; | |
| chrome.proxy.settings.set({value: config, scope: "regular"}, function() {}); | |
| function callbackFn(details) { | |
| return { | |
| authCredentials: { | |
| username: "{{ proxy_user }}", | |
| password: "{{ proxy_pass }}" | |
| } | |
| }; | |
| } | |
| chrome.webRequest.onAuthRequired.addListener( | |
| callbackFn, | |
| {urls: ["<all_urls>"]}, | |
| ['blocking'] | |
| ); | |