Я пытаюсь сделать расширение chrome для радио потока, но есть проблема. Когда я запускаю свой script в браузере, как обычный JS + HTML + CSS, он работает, но когда я пытаюсь запустить его, как расширение Chrome, я получаю эту ошибку:
Отказано от выполнения inline script, поскольку оно нарушает следующие Политика политики безопасности содержимого: "script -src 'self' chrome-extension-resource:". Либо ключевое слово "небезопасное-встроенное", либо hash ('sha256 -...'), или nonce ('nonce -...') требуется для включения встроенное выполнение.
После этого я добавил это в свой манифест:
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
Но после этого я получал сообщение об ошибке (ошибка в строке манифеста с кодом выше)
Это мой манифест:
{
"background": {
"scripts": [ "jquery.js", "jquery-ui.js", "plate.js" ]
},
"browser_action": {
"default_icon": "Images/action-normal.png",
"default_popup": "player.html",
"default_title": ""
},
"description": "Chrome Player",
"manifest_version": 2,
"name": "Radio Chrome Player",
"permissions": [ "http://www.radio-station.com/" ],
"version": "1.0"
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
}
Это основной файл html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="jquery.js"></script>
<script src="jquery-ui.js"></script>
<script src="main.js"></script>
<script>$(function(){$("#radioplayere").plate({playlist: [{file:"http://RADIO_STATION_STREAM_URL/;"}], phpGetter: "http://hostingshoutcast.com/stream/plate/php/plate.php"});});</script>
</head>
<body>
<div id="radioplayer">If you are seeing this then an error has occurred!</div>
</body>
</html>