像https://css-tricks.com/snippets/css/using-font-face/注意到资源与CSS @import
规则可用于字体,特别是谷歌字体:在Firefox中使用@import for html/css字体与noscript(谷歌字体不渲染)?
@import url(//fonts.googleapis.com/css?family=Open+Sans);
于是,我试着写了下面的小例子,(存储在本地电脑中说/tmp/ttt.htm
):
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=Oxygen:400,700);
body {
/*font: 18px/27px 'Oxygen', sans-serif;*/
font-family: 'Oxygen', sans-serif;
font-size: 18px;
line-height: 27px;
}
</style>
</head>
<body>
Testing a font here
</body>
</html>
但是,如果我在Firefox 42中打开此与NoScript的 - 即使/当我让file://
协议 - 我得到渲染这样的:
......这就是说,好像@import
已被完全忽略;如果我在另一个选项卡中打开http://fonts.googleapis.com,则在NoScript中允许它,然后回到本地HTML并在那里刷新它。但是,如果我打开Firefox的新实例,如:
firefox -no-remote -P "some other profile" /tmp/ttt.htm
...然后字体被正确呈现。
有没有什么办法可以在NoScript的Firefox中正确渲染这个例子 - 一旦给出NoScript权限?