I made a very simple straight forward bookmarklet to test an open web font we're developing. It works like a charm in Chrome but fails in Firefox, any tips on how can I make it work cross-browser (I'm a real JS novice, mainly copy pasting and then praying it works). Here's the code:
javascript:var%20addFont%3Ddocument.createElement(%22style%22)%3BaddFont.innerText%3D%22%40import%20url(%27https://dl.dropbox.com/u/16808833/webfontkit-20120729-105013/stylesheet.css%27)%3B%20*%7Bfont-family:%20%27OpenfontRegular%27!important%3Bfont-weight:%20normal!important%3B%7D%22%3Bdocument.body.appendChild(addFont)%3B
Or in a more readable format:
javascript:
var addFont=document.createElement('style');
addFont.innerText="
@import url('https://dl.dropbox.com/u/16808833/webfontkit-20120729-105013/stylesheet.css');
*{
font-family: 'OpenfontRegular'!important;
font-weight: normal!important;
}";
document.body.appendChild(addFont);