我决定基于this video进行解析器扩展。我做到了,但它给出了一个错误。为什么Chrome扩展程序解析器不起作用?给出错误消息
给出错误消息
拒绝加载脚本 'http://www.feedrapp.info/?callback=jQuery34105091845112378484_1568141475155&q=http%3A%2F%2Fvestirama.ru%2Fserver%2Fyandex.rss&_=1568141475156' 因为它违反了以下“内容安全策略”指令: “ script-src'self'blob:文件系统:chrome-extension-resource:”。注意 未明确设置“ script-src-elem”,因此使用“ script-src” 作为备用。
manifest.json
{
"name" :"Новости",
"version": "1.0",
"manifest_version": 2,
"description" :"Последние новости Оренбуржья",
"permissions": [
"cookies",
"background",
"tabs",
"http://*/*",
"https://*/*",
"storage",
"unlimitedStorage"
],
"icons": { "128": "images/icon.png" },
"content_scripts": [{
"matches": [ "http://vestirama.ru/*","http://vestirama.ru/server/yandex.rss" ],
"js": [ "jquery-3.4.1.min.js","moment.min.js","jquery.rss.js","jquery.rss.min.js","script.js" ],
"all_frames": true
}],
"web_accessible_resources": [
"http://*/*",
"https://*/*",
"styles/*",
"fonts/*"
],
"browser_action" :
{
"default_popup": "popup.html",
"default_title": "Новости ВестиРама"
}
}
popup.html
<html>
<head>
<meta charset="utf-8"/>
<title>Новости ВЕСТИРАМА</title>
<link href="style.css" rel="stylescheet"/>
<script type="text/javascript" language="javascript" src="jquery-3.4.1.min.js"></script>
<script type="text/javascript" language="javascript" src="moment.min.js"></script>
<script type="text/javascript" language="javascript" src="jquery.rss.js"></script>
<script type="text/javascript" language="javascript" src="script.js"></script>
</head>
<body>
<div class="container">
<div id="rss"></div>
</div>
</body>
</html>
script.js
$('#rss').rss("http://vestirama.ru/server/yandex.rss");
原始脚本路径
https://code.jquery.com/jquery-3.4.1.min.js
https://momentjs.com/downloads/moment.min.js
https://cdnjs.cloudflare.com/ajax/libs/jquery-rss/3.3.0/jquery.rss.js
请帮助我。