我正在使用 Google 日历 API 并尝试在后台页面加载日历 api js 脚本并收到错误作为内容脚本
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.
Run Code Online (Sandbox Code Playgroud)
尝试更改manifest.json并设置权限和内容安全策略来评估unsafe-eval
。我正在使用 webpack 并看到这篇文章(由 Webpack 编译的 Chrome 扩展抛出 `unsafe-eval` 错误)并将 webpack 模式更改为生产并将其添加到我的 webpack 配置文件中devtool = 'cheap-module-eval-source-map';
以下是对我的 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 …
Run Code Online (Sandbox Code Playgroud) google-calendar-api google-chrome-extension content-security-policy reactjs webpack
我需要实现一个 javascript 项目,该项目根据登录的用户创建一个新的 google meet,并将事件添加到日历并获取 google meet 的 url。如何在 JS 中使用 Google Calendar API 创建新的 google meet。