Javascript 加载我的脚本时出错(Google Chrome扩展)

Javascript 加载我的脚本时出错(Google Chrome扩展),javascript,html,google-chrome,google-chrome-extension,video-game-consoles,Javascript,Html,Google Chrome,Google Chrome Extension,Video Game Consoles,我制作了一个在谷歌浏览器扩展中运行的脚本。我很快解释道: 有一款在线游戏叫《龙游》。脚本所做的是计算你必须向对手射击的力量。好的,我已经尝试在外部服务器上容纳我的脚本,显然已经加载但没有执行(“加载”)。我认为错误可能在代码中(我使用视频游戏的javascript创建脚本)。代理原始代码、json和调用外部脚本的js: chrome.extension.sendRequest({type:"init"},function(response){ if(response.ingame){

我制作了一个在谷歌浏览器扩展中运行的脚本。我很快解释道: 有一款在线游戏叫《龙游》。脚本所做的是计算你必须向对手射击的力量。好的,我已经尝试在外部服务器上容纳我的脚本,显然已经加载但没有执行(“加载”)。我认为错误可能在代码中(我使用视频游戏的javascript创建脚本)。代理原始代码、json和调用外部脚本的js:

chrome.extension.sendRequest({type:"init"},function(response){

    if(response.ingame){
        chrome.extension.sendRequest({id:"loading",type:"notification2",text:["Loading","Loading scripts from dropbox.com..."]}, function(response) {});
        chrome.extension.sendRequest({type:"loadscript",url:'http://dl.dropbox.com/u/91461506/prueba2.js',cache:false}, function(response) {
            if(response.type == 1){
                eval(response.scriptcontent);

            }else if(response.type == 0){
                chrome.extension.sendRequest({id:"loading",type:"closenotification2"}, function(response) {})
                chrome.extension.sendRequest({id:"errorloading",time:0,type:"notification2",text:["Error","Failed to load the script, try again later"]}, function(response) {});
            }
        });
    }else{
        chrome.extension.sendRequest({type:"loadscript",url:'http://dl.dropbox.com/u/91461506/page.js',cache:false}, function(response) {
            if(response.type == 1){
                eval(response.scriptcontent);
                PAGEDBA.init();
            }else if(response.type == 0){

            }
        });
    }
});

Manifest.json

{
  "name": "DragonBound Aimbot 2.0",
  "version": "2.0.0",
  "manifest_version": 2,
  "description": "DragonBound Aimbot Hack - HTML5",
   "browser_action": {
    "default_popup": "popup.html",
    "default_icon": "icon.png"
  },
   "permissions": ["tabs", "notifications", "http://*.dropbox.com/u/91461506/*", "https://*.dropbox.com/u/91461506/*"],
   "background": { "page": "background.html", "persistent" : false },
"content_scripts": [
    {
      "matches": ["http://*.dragonbound.net/*","http://*.dropbox.com/u/91461506/*"],
      "js": ["jquery2.js","DragonBoundAimbot.js"],
      "run_at": "document_end"
    }
  ],
  "icons": {"16": "16.png", "48": "48.png", "128": "128.png"},
  "web_accessible_resources": [
    "ranks/*","48.png"
  ],
  "homepage_url" : "http://www.dropbox.com"
}
-代码调用外部脚本:

chrome.extension.sendRequest({type:"init"},function(response){

    if(response.ingame){
        chrome.extension.sendRequest({id:"loading",type:"notification2",text:["Loading","Loading scripts from dropbox.com..."]}, function(response) {});
        chrome.extension.sendRequest({type:"loadscript",url:'http://dl.dropbox.com/u/91461506/prueba2.js',cache:false}, function(response) {
            if(response.type == 1){
                eval(response.scriptcontent);

            }else if(response.type == 0){
                chrome.extension.sendRequest({id:"loading",type:"closenotification2"}, function(response) {})
                chrome.extension.sendRequest({id:"errorloading",time:0,type:"notification2",text:["Error","Failed to load the script, try again later"]}, function(response) {});
            }
        });
    }else{
        chrome.extension.sendRequest({type:"loadscript",url:'http://dl.dropbox.com/u/91461506/page.js',cache:false}, function(response) {
            if(response.type == 1){
                eval(response.scriptcontent);
                PAGEDBA.init();
            }else if(response.type == 0){

            }
        });
    }
});
我已经上传了Google Chrome的扩展,并且扩展未压缩:

视频游戏网页的链接是

您使用的
eval()
,但chrome extensions中禁用了
eval()

您使用
eval()
,但是
eval()
在chrome扩展中被禁用


对于这种情况,最简单的解决方案是将您尝试加载的文件包含在扩展本身中。对于这种情况,最简单的解决方案是将您尝试加载的文件包含在扩展本身中。