我非常喜欢这个扩展,但是作者没有更新它,所以我想自己修复它并使用它;但是发生了这个错误:
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.
清单.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---错误点:</p>
<!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
那么,代码有什么问题?谢谢 !