Google chrome extension 无法解决google chrome扩展CSP错误

Google chrome extension 无法解决google chrome扩展CSP错误,google-chrome-extension,Google Chrome Extension,我正在尝试创建我的第一个chrome扩展,这是我的manifest.json { "name": "share2twitter", "version": "0.1", "manifest_version": 2, "browser_action":{ "default_icon": "icon.png", "default_popup": "index.html" }, "background": {"page":

我正在尝试创建我的第一个chrome扩展,这是我的manifest.json

{
    "name": "share2twitter",
    "version": "0.1",
    "manifest_version": 2,
    "browser_action":{
        "default_icon": "icon.png",
        "default_popup": "index.html"
    },
    "background": {"page": "index.html"},
    "permissions": [
        "https://www.googleapis.com/*",
        "tabs"
        ],
    "content_scripts": [{
        "matches": [ "http://*/*", "https://*/*" ],
        "js": [ "jquery.min.js","index.js" ]
    }],
    "content_security_policy": "script-src https://www.googleapis.com/urlshortener/ 'self'; object-src 'self'; connect-src https://www.googleapis.com/"

}
在调试模式下,我得到以下错误

Refused to load script from 'https://www.googleapis.com/urlshortener/v1/url?callback=jQuery17108621194534935057_1344774835421&{%22longUrl%22:%22https://groups.google.com/a/chromium.org/forum/?fromgroups' because of Content-Security-Policy.
我查看了mappy、stackoverflow.com和google官方文档的参考资料,但没有任何结果。所以我在这里请求帮助

预期行为:
当我单击扩展时,它会尝试连接到goo.gl url shortner并显示警报框

内容安全策略值中不允许源URL中的路径。您需要在清单中使用此选项:

“内容安全策略”:“脚本src”https://www.googleapis.com 'self';对象src'self';连接srchttps://www.googleapis.com“

已经存档(并且正在进行一些工作),以便在这种情况下更好地发出警告