Ошибка расширения Chrome: отказался выполнять встроенный обработчик событий, потому что - PullRequest
0 голосов
/ 11 июня 2018

Мне очень нравится расширение, но автор больше не обновляет его, поэтому я хочу исправить его и использовать его самостоятельно, но возникла эта ошибка:

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.

ошибка 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

Итак, что не так с кодом?спасибо!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...