I am trying to create my first chrome extensions, here is my 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/"
}
https://github.com/kracekumar/share2twitter/blob/master/manifest.json and in debug mode I get the following error .
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.
I looked into reference for mappy, stackoverflow.com and google official docs, nothing worked out. So I am asking help here.
Expected behaviour:
When I click on the extension , it tries to connect to goo.gl url shortner and displays alert box.
Paths in source URLs are not allowed in Content Security Policy values. You’ll need to use this in your manifest:
"content_security_policy": "script-src https://www.googleapis.com 'self'; object-src 'self'; connect-src https://www.googleapis.com"A Chromium bug has been filed (and has some ongoing work) to better warn in this situation.