chrome扩展错误:拒绝执行内联事件处理程序,因为

时间:2018-06-11 13:02:40

标签: javascript google-chrome-extension

我非常喜欢扩展程序,但是作者并没有更新它,所以我想修复它并自己使用它;但是发现了这个错误:

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

error shotpic

的manifest.json:

{
"update_url": "https://clients2.google.com/service/update2/crx",
"description": "fixed One-Click Extensions Manager",
"name": "__MSG_extname__",
"version": "1.3.4.0",
"permissions": ["management", "storage"],
"browser_action":
{
    "default_icon": "icon32.png",
    "default_title": "__MSG_extname__",
    "default_popup": "popup.html"
},
"icons":
{
    "32": "icon32.png",
    "64": "icon64.png",
    "128": "icon128.png"
},
"content_scripts": [
{
    "js": ["zepto.min.js", "myscript.js"],
    "matches": ["*://*/*"],
    "run_at": "document_end"
}],
"default_locale": "zh_CN",
"manifest_version": 2

}

popup.html ---错误点:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>__MSG_extname__</title>
    <link rel="stylesheet" href="main.css">
</head>

<body>
    <ul id="extensions_list"></ul>
    <script src="myscript.js"></script>
    <script src="zepto.min.js"></script>
</body>

</html>

myscript.js ---代码太多并粘贴在: https://pastebin.com/6NrsuzZA

那么,代码有什么问题?谢谢!

0 个答案:

没有答案
相关问题