Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use @font-face on a Chrome Extension in a Content Script

Tags:

Since I can't use chrome.extension.getURL() on a CSS file, how can I use @font-face with a local font file?

like image 999
Tomás Senart Avatar asked Dec 26 '10 23:12

Tomás Senart


People also ask

How do I add a font to Chrome extension?

Google FontsClick on the download link (top right): Select 'Collection as zip': Then place the fonts you want into a new folder in your extension.

How do I use face fonts in HTML?

You can use a <basefont> tag to set all of your text to the same size, face, and color. The font tag is having three attributes called size, color, and face to customize your fonts. To change any of the font attributes at any time within your webpage, simply use the <font> tag.


1 Answers

Here is how to get local path in css:

body {   background-image:url('chrome-extension://__MSG_@@extension_id__/background.png'); } 

More about it here.

like image 198
serg Avatar answered Sep 18 '22 18:09

serg