chrome 扩展内容安全策略1

时间:2021-07-15 16:49:20

标签: angular google-chrome

我在实现 chrome 扩展时遇到了这个错误。 拒绝加载脚本“https://apis.google.com/js/platform.js”,因为它违反了以下内容安全策略指令:“script-src 'self' https://apis.google.com/js/api.js 'unsafe-inline' '不安全评估'”。请注意,'script-src-elem' 未明确设置,因此使用 'script-src' 作为后备。

1 个答案:

答案 0 :(得分:0)

在 Chrome 扩展清单 v3 remotely hosted code is no longer allowed 中。和内联脚本。

请参阅 How can I use the Google API in a chrome extension? 了解解决方法。