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

Tomás Senart picture Tomás Senart · Dec 27, 2010 · Viewed 12.1k times · Source

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

Answer

serg picture serg · Dec 27, 2010

Here is how to get local path in css:

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

More about it here.