Extension Chrome.Proxy, Only Proxy To Some of Webs

2019-03-04 10:03发布

So Bypasslist in chrome.proxy will bypass the list from using proxy, but what i need is proxy only some of website i want like only 4 website and except that bypass by the proxy, if i need to make a list inside bypass list it will be hell.

Can i do that with chrome.proxy ? So Only Some Website Get Proxied.

1条回答
Summer. ? 凉城
2楼-- · 2019-03-04 10:45

The documentation provides an example where you specify a PAC script:

var config = {
  mode: "pac_script",
  pacScript: {
    data: "function FindProxyForURL(url, host) {\n" +
          "  if (host == 'foobar.com')\n" +
          "    return 'PROXY blackhole:80';\n" +
          "  return 'DIRECT';\n" +
          "}"
  }
};
chrome.proxy.settings.set(
    {value: config, scope: 'regular'},
    function() {});

The example does exactly what you require for 1 domain, and it should be possible to extend to several domains.

查看更多
登录 后发表回答