Click here to Skip to main content
15,748,748 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)

I am trying to use Google APIs Client Library to develop a Chrome Extension. The problems is that I cannot inject this script in background page to access the API:
<script src=""></script>

Debug in Chrome throw an error:
Refused to load the script '' because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".

which is mentioned in this page[^]. Therefore, only local script and and object resources are loaded.
I tried to download the client.js file and include it in my package but it didn't help at all.
Is there any solution for this problem?
I am using manifest version 2.
Updated 6-Aug-12 18:45pm

1 solution

add this to your manifest file , it will work fine
"content_security_policy": "script-src 'self'; object-src 'self'"
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900