我需要设置代理。我用它,但现在我需要用登录名和密码设置代理。我该怎么办?
的manifest.json
"permissions": [
"tabs",
"http://*/*",
"https://*/*",
"notifications",
"contextMenus",
"history",
"background",
"proxy"
],
和background.js
chrome.windows.onCreated.addListener(function() {
var config = {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme: "http",
host: "127.0.0.1",
port: 8000
},
bypassList: ["foobar.com"]
}
};
chrome.proxy.settings.set(
{value: config, scope: 'regular'},
function() {});
});