为什么Firefox中的Web字体不在不同的域中工作? [英] Why don't web fonts in Firefox work on a different domain?

查看:180
本文介绍了为什么Firefox中的Web字体不在不同的域中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Firefox 3.5中尝试最新的OpenType字体功能我遇到了一个问题。我试图嵌入字体在不同的网页,它将被使用的不同的域,它没有工作。我认为这可能是一个错误,但从我在MDC参考页面上读到,我注意到这个注意:

I was experimenting with the fancy new OpenType font capability in Firefox 3.5 and I ran into a problem. I was trying to embed a font on a different domain than the page it would be used on, and it didn't work. I thought it may have been a bug, but from what I read on the MDC reference page, I noticed this note:


在Gecko,网络字体受到相同的域限制(字体文件必须与使用它们的网页位于同一网域),除非使用HTTP访问控制来放宽此限制。

In Gecko, web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless HTTP access controls are used to relax this restriction.

看起来他们有意设计了浏览器。出于好奇,为什么他们会这样做?嵌入字体有任何安全风险吗?还是针对合法的商标或版权问题?

It looks like they designed the browser that way on purpose. Out of curiosity, why would they do that? Is there any security risk with embedding a font? Or is it for legal trademark or copyright issues? Or something else?

推荐答案

如果你想绕过它,你可以尝试添加到你的.htaccess:

If you want to bypass it you could try adding this to your .htaccess:

Header set Access-Control-Allow-Origin *

要回答您的问题,这可能与以下事实有关:从版本3.5开始,Firefox支持跨来源共享标准

To answer your question, it's probably related to the fact that since version 3.5 Firefox supports the cross-origin sharing standard.

这篇关于为什么Firefox中的Web字体不在不同的域中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆