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

  • Specify `https://apis.google.com/js/api.js` directly in the `Content-Security-Policy`? – Rafa Guillermo May 19 '21 at 08: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 –  May 19 '21 at 10:00
  • Do these answers help? https://stackoverflow.com/questions/18681803/loading-google-api-javascript-client-library-into-chrome-extension – Rafa Guillermo May 24 '21 at 07:20

0 Answers0