Skip to content

Instantly share code, notes, and snippets.

@tqk2811
Created April 12, 2021 18:28
Show Gist options
  • Save tqk2811/eae005285944dde9054128866433e65f to your computer and use it in GitHub Desktop.
Save tqk2811/eae005285944dde9054128866433e65f to your computer and use it in GitHub Desktop.
ProxyExt
var config = {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme: "http",
host: "{host}",
port: "{port}"
},
bypassList: ["localhost"]
}
};
chrome.proxy.settings.set({value: config,scope: "regular"}, function () {});
function callbackFn(details) {
return {
authCredentials: {
username: "{username}",
password: "{password}"
}
};
}
chrome.webRequest.onAuthRequired.addListener(callbackFn, {urls: ["<all_urls>"]}, ['blocking']);
{
"version": "1.0.0",
"manifest_version": 2,
"name": "ChromeProxy",
"permissions": [
"proxy",
"<all_urls>",
"webRequest",
"webRequestBlocking"
],
"background": {
"scripts": [
"background.js"
]
},
"minimum_chrome_version": "22.0.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment