【问题标题】:Google fonts treated as insecure script in chrome谷歌字体在 chrome 中被视为不安全的脚本
【发布时间】:2014-10-12 05:35:11
【问题描述】:

当我在 HTTPS 页面中使用 Google 字体但它在 chrome 中被视为“不安全脚本”时。

有没有办法解决这个问题?

我得到了这个:

http://snag.gy/9FAx3.jpg

我正在使用@import 导入它。

【问题讨论】:

  • 您在加载 Google 字体时使用的是 https:// 吗?如果是这样,您能否发布您在 Chrome 中看到的确切错误消息?并向我们​​展示您用于检索 Google 字体的网址/方法。
  • @Shai 更新了问题
  • 谢谢。你能包括整个@import 行吗?我怀疑与@edwardm 的答案相同——您可能将其加载为http:// 而不是https://(或//)...

标签: css google-chrome fonts secure-coding


【解决方案1】:

使用https 或直接在href 中关闭协议。例如:

<link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-01
    • 2013-06-28
    • 2014-12-17
    • 2013-04-20
    • 2012-11-23
    • 2014-05-16
    • 2018-03-11
    • 1970-01-01
    相关资源
    最近更新 更多