使用带有密码和登录的Google Chrome扩展程序设置代理

时间:2018-02-11 16:01:39

标签: google-chrome browser google-chrome-extension proxy

我需要设置代理。我用它,但现在我需要用登录名和密码设置代理。我该怎么办?

的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() {});

});

0 个答案:

没有答案