我在这里遇到了一些严重的问题,我尝试为gmail构建chrome扩展程序,但是我的界面或内容脚本都没有加载,每次检查弹出控制台时都会看到此错误。
Unchecked runtime.lastError while running tabs.executeScript:
This page cannot be scripted due to an ExtensionsSettings policy.
at Object.callback (chrome-extension://hchilaodbnedmljenkfdfpjmgmlkmpci/js/popup.js:247:17)
该错误与我的JSON文件有关吗?
我声明内容脚本如下
{
"name": "name",
"version": "1.0",
"description": "description",
"permissions": [
"activeTab",
"tabs",
"*://mail.google.com/*",
"declarativeContent",
"storage",
"contentSettings"
],
"background": {
"scripts": ["js/send.js"],
"persistent": false
},
"browser_action": {
"default_popup": "index.html",
"default_icon": {
"16": "images/imagege1.png",
}
},
"icons": {
"16": "images/image1.png",
},
"web_accessible_resources": [
"css/bootstrap.min.css",
"js/jquery-3.3.1.slim.min.js",
"js/popper.min.js",
"js/bootstrap.min.js"
],
"content_scripts": [{
"matches": [
"*://mail.google.co.in/*",
],
"css": [
"css/bootstrap.min.css"
],
"js": [
"js/jquery-3.3.1.slim.min.js",
"js/bootstrap.js",
"js/send.js",
"js/bootstrap.min.js"
],
"run_at": "document_end",
"all_frames": true
}],
"manifest_version": 2
}
这是一段JS代码,以防万一有人需要
答案 0 :(得分:0)
我遇到的问题甚至与内容脚本无关,我所在的组织内部网络不允许在我使用的私人gmail中执行我的扩展,并且需要组织本身提供的其他令牌需要在清单文件中使用该键。