在 Firefox Web 扩展中加载字体

发布于 2025-01-13 18:12:01 字数 415 浏览 4 评论 0原文

我正在尝试将 chrome 扩展移植到 firefox,但在内容脚本中加载字体时遇到困难。 我将我的字体文件与扩展程序捆绑在一起,然后我使用试图加载字体的 css 加载内容脚本,但是我收到了这样的错误

Security Error: Content at https://github.com/roberthovsepyan may not load or link to moz-extension://019740cc-47f5-44fd-bd62-f715c7e8e18c/c73abe648eae6ea7e72f.woff.

它在 chrome 中运行良好,并且已经存在很多年了。但由于某些原因,它在 Firefox 中不起作用。我的清单文件中的 web_accessible_resources 中有字体。

任何帮助将不胜感激。

I'm trying to port my chrome extension to firefox, but I'm having a hard time loading fonts in content scripts.
I have my font files bundled with the extension, then I load the content script with css that is trying to load fonts, however I'm getting an error like this

Security Error: Content at https://github.com/roberthovsepyan may not load or link to moz-extension://019740cc-47f5-44fd-bd62-f715c7e8e18c/c73abe648eae6ea7e72f.woff.

It works fine with in chrome and has been for many years. But for some reason in firefox it just won't work. I have the fonts in my web_accessible_resources in the manifest file.

Any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文