【发布时间】:2021-04-28 02:08:59
【问题描述】:
我最近将 Google AdSense 添加到我的网站并且广告运行良好,但有时它们无法加载并且我在控制台中收到以下错误
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src https://cdn.ampproject.org/". Either the 'unsafe-inline' keyword, a hash ('sha256-xxx'), or a nonce ('nonce-...') is required to enable inline execution.
根据我阅读的内容,我需要在我的 HTML 标头中添加 CSP,但似乎无法解决问题。
有什么建议吗?
【问题讨论】:
标签: content-security-policy adsense