Firefox extension custom fonts
If you look into the console messages, this is what you should see:
downloadable font: download not allowed (font-family: "FontAwesome" style:normal weight:normal stretch:normal src index:0): bad URI or cross-site access not allowed
Unfortunately for you, web fonts are subject to the same-origin policy which can only be relaxed via CORS. This means that there is no way to load the font file from an extension URL as there is no way to use CORS there.
This leaves you with two options:
- You host the font on a web server with proper CORS headers or use some existing font hosting.
- You encode the font as a data: URI. There is a number of data: URI generators available, e.g. this one.
IMHO the second solution is the preferable one as your extension won't be dependent on any web servers, especially not third-party web servers. Also, it won't introduce any delays caused by font downloading. I tried it and it worked fine:
@font-face {
font-family: 'FontAwesome';
src: url('data:application/octet-stream;base64,d09GRgAB...') format('woff');
font-weight: normal;
font-style: normal;
}
Side-note: You don't need the full backwards compatibility dance in a Firefox extension, it's sufficient to have the font in the WOFF format.