由于内容安全策略的限制,我无法在着陆页插件中让脚本标签正常工作

由於 CSP 限制,內嵌的 JS 腳本標籤無法加載,我不知道如何修復。

2 个赞

此帖子中的一些信息可能有所帮助:Mitigate XSS Attacks with Content Security Policy

1 个赞

我已经阅读了这些和其他内容,但仍然无法理清如何实际将例外添加到 content_security_policy_script_src。

1 个赞

您的浏览器控制台中是否出现有关脚本的错误?类似这样?

您需要将提供的哈希值('sha256-xxxxx')添加到管理员 > 所有站点设置中找到的“内容安全策略脚本源”设置中。

1 个赞

我在 Firefox 浏览器中遇到的错误是 nonce-s0m3h4sh,而我没有遇到 sha256-s0m3h4sh。但当我刚才在 Chrome 中查看时,它却是 sha256 的那个。

2 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.