firefox(ff)下无法显示bootstrap图标问题的解决方案(转)

时间:2022-08-29 12:44:38

原文链接:

http://www.th7.cn/web/html-css/201502/82548.shtml

后在网上搜到了解决方案,在此分享以供各位遇到问题的同好参考:在ff的地址栏中输入“about:config”,即进入配置界面。进入后,搜 索“security.fileuri.strict_origin_policy”,这是该值应该是true。双击该项,其值自动变为false,即 可。修改后,再刷新遇到问题的页面,即可看到正常显示的图标了。

 

  那是什么原因导致了这个问题的出现呢?原因是ff的一个安全策略导致的。该策略限制了HTML文件访问不在根目录下的文件夹中的web fonts。这种限制只在本地开发环境下,同时web fonts并未从远程获取时出现。

 

  后来看了下前面提到的那个没有出现问题的bootstrap项目。果然,其fonts文件夹被放置在了项目的根目录下。这样即使不去改变上述安全策略,也是可以正常显示的。

Firefox has a strict setting(this) that prevents your HTML file from accessing your web fonts from folders not on the root. This only happens when you work locally and not from files on a server. You have to change a setting in Firefox to display the glyphicons when you develop locally.

-open "about:config" in your address in firefox

-Then search for "security.fileuri.strict_origin_policy" property and change it from "true" to "false". (ignore quotation marks of course)

http://*.com/questions/19085942/boootstrap-glyphicons-firefox-issues