admin管理员组文章数量:1335410
I am using a content script to inject some HTML into a webpage. I am trying to use the google font, CabinCondensed-Regular, and a number of icon fonts gotten from IcoMoon. I have downloaded the files and am including them in the CSS with @font-face
, because from what I can tell it's faster, but I don't know how to include them in the manifest.json. Normally you could specify a file by
"content_scripts": [
{
"matches": [ "<all_urls>"],
"css":["style.css", "jquery-ui.css"],
"js":["jquery-2.1.0.min.js", "index.js", "jquery-ui.min.js"],
}
but as far as I can tell there is no specific tag for fonts, so how can I include the ttf files?
I am using a content script to inject some HTML into a webpage. I am trying to use the google font, CabinCondensed-Regular, and a number of icon fonts gotten from IcoMoon. I have downloaded the files and am including them in the CSS with @font-face
, because from what I can tell it's faster, but I don't know how to include them in the manifest.json. Normally you could specify a file by
"content_scripts": [
{
"matches": [ "<all_urls>"],
"css":["style.css", "jquery-ui.css"],
"js":["jquery-2.1.0.min.js", "index.js", "jquery-ui.min.js"],
}
but as far as I can tell there is no specific tag for fonts, so how can I include the ttf files?
Share Improve this question asked Apr 6, 2014 at 23:22 EasilyBaffledEasilyBaffled 3,88210 gold badges55 silver badges92 bronze badges1 Answer
Reset to default 9Looks like you can use "web_accessible_resources"
to link your font files (instead of "content_scripts"
. Then just make sure your @font-face
path is correct to the font files. See: https://developer.chrome./extensions/manifest/web_accessible_resources
本文标签: javascriptInclude ttf files in chrome extension content scriptStack Overflow
版权声明:本文标题:javascript - Include ttf files in chrome extension content script - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742388628a2465543.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论