![](/img/trans.png)
[英]Refused to load scripts because it violates the following Content Security Policy directive
[英]Refused to load the script because it violates the following Content-Security-Policy
我没有在我的代码中使用 google tag manager url 但它仍然显示错误并且这里是错误。
错误
拒绝加载脚本“https://consent.trustarc.com/v2/notice/jznryc”,因为它违反了以下内容安全策略指令:“script-src 'self' 'unsafe-inline' https://www. googletagmanager.com”。 请注意,未明确设置“script-src-elem”,因此“script-src”用作后备。
这是我正在使用的代码。
<meta http-equiv="Content-Security-Policy" content=
"default-src *;
style-src 'self' 'unsafe-inline' ;
script-src 'self' 'unsafe-inline' https://consent.trustarc.com ;
script-src-elem 'self' 'unsafe-inline' ">
最可能的解释是设置了两个(或更多)策略。 正在设置另一个 CSP,可能在响应 header 中。您将需要找到该策略并修改/删除它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.