Chrome代理商扩展程序无法更改IP

时间:2017-05-18 12:35:09

标签: google-chrome google-chrome-extension

我尝试创建在用户点击按钮时更改IP的扩展程序,但IP没有改变,我也不知道为什么。我尝试了很多代理主机和IP,但它并没有改变情况。

popup.js

document.addEventListener('DOMContentLoaded', function() {
  const button = document.querySelector('.button')
  const config = {
    mode: 'fixed_servers',
    rules: {
      proxyForHttp: {
        scheme: 'socks5',
        host: '98.111.239.128',
        port: 56053
      },
      bypassList: ['foobar.com']
    }
  }

  // Enable proxy
  button.addEventListener('click', function() {
    return chrome.proxy.settings.set({
      value: config,
      scope: 'regular'
    }, function() {})
  })
})

的manifest.json

{
  "manifest_version": 2,

  "name": "VPN for vk.com",
  "description": "Easy VPN for visit vk.com",
  "version": "1.0",

  "browser_action": {
    "default_icon": "lib/src/img/icon.png",
    "default_popup": "lib/popup.html"
  },
  "permissions": [
    "storage",
    "proxy"
  ]
}

0 个答案:

没有答案