I get this error, but i can not figure out the fix for it:
Refused to load the script ‘http://api.ustream.tv/json/channel/…’ because it violates the following Content Security Policy directive: “script-src ‘self’ chrome-extension-resource:”.
Is there any way i can remove this error? Here is my json code.
{
"manifest_version": 2,
"name": "COD Television Live Checker",
"version": "1.0",
"description": "The Official Crome Extension of CodTelevision.com - Live Checker",
"browser_action":
{
"default_icon": "icon.png",
"default_popup": "main.html"
}
"permissions": ["http://api.ustream.tv/json/channel/*"]
}
and my html code:
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="jquery-latest.js"></script>
<script type="text/javascript" src="popup.js"></script>
</head>
<body>
<center><span id="status1">No Data</span></center>
</body>
</html>
and finally my javascript:
var query = 'http://api.ustream.tv/json/channel/...';
jQuery.getJSON(query, function(data) {
if (data == 'live') {
document.getElementById("status1").innerText = "LIVE";
} else {
document.getElementById("status1").innerText = "OFFLINE";
}
});
You have to set the correct permission in the manifest file:
As can be found here in the docs.
UPDATE
I see that you are using the v2 manifest. In that case you should add the following to your manifest: