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?
Looks 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.com/extensions/manifest/web_accessible_resources
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With