如何使Chrome Extention代理正常工作

问题描述

我正在尝试使用chrome代理,但是它失败了很惨:(。我能帮忙使其工作吗?这是我现在的代码:

Manifest.json

 {

      "manifest_version": 2,"name": "DragonVPN","description": "A privacy chrome extention","version": "3.0","background": {
      "scripts":["background.js"]
      },"browser_action" : {
        "default_popup": "popup.html","default_title": "Dragon VPN","default_icon": {
        "16": "img/reddragon.png","32": "img/reddragon.png","48": "img/reddragon.png","128": "img/reddragon.png"
      }
        },"permissions": [
        "tabs","http://*/*","https://*/*","notifications","contextMenus","history","background","proxy"
    ],"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
    }

Background.js

//var myHost = "200.33.143.75";
//var myPort = 49346;
var myHost = "173.192.128.238";
var myPort = 8123;

var config = {
  mode: "direct",rules: {
    singleProxy: {
      scheme: "socks5",host: myHost,port: myPort
    },bypassList: ["example.com"]
  }
};


      chrome.proxy.settings.get(
          {'incognito': false},function(config) {console.log(JSON.stringify(config));});
      

Popup.html

<!DOCTYPE HTML>

<html>
<head>
<link rel="stylesheet" href="popup.css">

</head>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<button class="button">Hi</button>
</html>

Popup.css

body {
width:440px;
height:540px;
background-image:url("img/background1.jpg");
text-align:center;
}
.fade {
animation: fadeInAnimation ease 3s; 
            animation-iteration-count: 1; 
            animation-fill-mode: forwards;
}
.button {
width:170px;
height:60px;
border-radius:2px;
border:none;
background-color:#018442!important;
}

当我将其加载到Chrome中时,网站无法正常工作,并且我不确定是什么破坏了一切,即使删除了作为主要代理代码的background.js,它仍然无法正常工作。我想知道我是否缺少某些东西。我在基本os linux hera上运行。 Chromium版本85.0.4183.121(正式版本)建立在Ubuntu上,运行在基本5.1.7(64位)上。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...