当我尝试连接到 StackOverflow API 以获取数据时出现以下错误:拒绝加载脚本
因为它违反了以下内容安全策略指令:"script-src 'self' 'unsafe-eval'"
.
这是我的清单文件:
{
"manifest_version": 2,
"background" : { "page": "background.html"},
"browser_action": {
"default_icon": "images/16.png",
"default_popup": "popup.html",
"default_title": "Test"
},
"content_security_policy": "script-src 'self' 'unsafe-eval'; connect-src 'self' http://stackoverflow.com/ http://api.stackoverflow.com/; object-src 'self'",
"content_scripts": [ {
"all_frames": true,
"js": [ "javascripts/settings.js" ],
"matches": [ "http://*/*", "https://*/*", "ftp://*/*" ],
"run_at": "document_start"
} ],
"description": "test api.",
"icons": {
"128": "images/128.png",
"16": "images/16.png",
"48": "images/48.png"
},
"options_page": "options.html",
"minimum_chrome_version": "9",
"name": "Test Test",
"permissions": [
"tabs",
"contextMenus",
"storage",
"webRequest",
"*://*.stackoverflow.com/*",
"*://stackoverflow.com/*"
],
"version": "1.1"
}
我没有任何内联脚本。
知道我在这里缺少什么吗?