未经检查的runtime.lastError:无法访问chrome:// URL

时间:2019-05-16 07:16:36

标签: javascript google-chrome-extension

在Google chrome扩展程序中,background.js的执行脚本未加载文件。

background.js

chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {

    chrome.tabs.executeScript(tabId, {
        file: 'index.js'
    });
});

manifest.json

{
    "manifest_version": 2,
    "permissions": [
        "activeTab",
        "declarativeContent",
        "storage",
        "tabs",
        "file://*/*",
        "https://*/*",
        "http://*/*"
    ],
    "background": {
        "scripts": ["js/jquery.min.js", "js/background.js"],
        "persistent": true
    },
    "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'"
}

错误是

  
      
  1. 未经检查的runtime.lastError:无法访问chrome:// URL
  2.   
  3. 未经检查的runtime.lastError:无法加载文件:“ index.js”。
  4.   
  5. 未经检查的runtime.lastError:无法访问URL“ chrome-search://local-ntp/local-ntp.html”的内容。扩展清单必须   请求访问此主机的权限。
  6.   

0 个答案:

没有答案