I am using Google calendar API and trying to load the calendar api js script in the background page and receiving error as content scripts
Refused to load the script 'https://apis.google.com/js/api.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
Tried changing the manifest.json and setting the permissions and content security policy to evaluate unsafe-eval
. I am using webpack and saw this post (Chrome extension compiled by Webpack throws `unsafe-eval` error) and change the webpack mode to production and added this to my webpack configuration file devtool = 'cheap-module-eval-source-map';
The following are the changes made to my manifest.json
1. "permissions": ["https://*.google.com/"],
"content_security_policy": "script-src 'self' https://www.google.com; object-src 'self'",
2. "permissions": ["background"],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"