0

I am working on a extension that will get your events on your google calendar. I followed this tutorial here. I got it working on my browser by hosting it using python, but when I load my extension into chrome it does not work. This is the error:

Refused to load the script 'https://apis.google.com/js/api.js' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem:". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

here is my manifest.json:

{
    "manifest_version": 2,
  
    "name": "Google Calendar Extension",
    "description": "Gets google calendar api and displays future events.",
    "version": "1.0",
  
    "browser_action": {
     "default_icon": "icon.png",
     "default_popup": "index.html"
    },
    "Content-Security-Policy": "script-src 'self'  https://apis.google.com ; object-src 'self'"
  }

Any way to fix it or do I have to do it another way

3
  • Specify https://apis.google.com/js/api.js directly in the Content-Security-Policy? Commented May 19, 2021 at 8:27
  • I changed the line to be like this: "content_security_policy": "script-src 'self' https://apis.google.com/js/api.js ; object-src 'self'" It still gives the same error Commented May 19, 2021 at 10:00
  • Do these answers help? stackoverflow.com/questions/18681803/… Commented May 24, 2021 at 7:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.