gpt4 book ai didi

html - Google 字体违反内容安全政策

转载 作者:行者123 更新时间:2023-11-27 22:49:50 25 4
gpt4 key购买 nike

我正在尝试使用 Google 字体,我从来没有遇到过任何问题,但现在当我尝试在我的页眉上添加 CSS 文件时,我在控制台上收到此错误:

拒绝加载样式表 'http://fonts.googleapis.com/css?family=Whatever' 因为它违反了以下内容安全策略指令:"style-src ' self' '不安全内联'”

最佳答案

这里有两件事需要解决:

  • 为 Google 字体链接使用 https (https://fonts.googleapis.com/css?family=Whatever)
  • 授权 https://fonts.googleapis.comstyle-src 指令和 https://fonts.gstatic.comfont-src 指令:"style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com"

关于html - Google 字体违反内容安全政策,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59501541/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com