[英]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.