首页 > 解决方案 > chrome 扩展内容安全策略1

问题描述

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

标签: angulargoogle-chrome

解决方案


在 Chrome 扩展清单 v3中,不再允许远程托管代码。和内联脚本。

请参阅如何在 chrome 扩展中使用 Google API?解决方法。


推荐阅读