我收到此错误,但我无法找出解决方法:
拒绝加载脚本“http://api.ustream.tv/json/channel/...”,因为它违反了以下内容安全策略指令:“script-src 'self' chrome-extension-resource:”。
有什么办法可以消除这个错误?这是我的json代码。
{
"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/*"]
}
和我的html代码:
<!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>
最后是我的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";
}
});