osx - Adblock filter not working in Safari

07
2014-07
  • this.lau_

    I've added the following filter to Safari (7.0.3 OSX) to block web fonts:

    .woff|
    

    which, if I'm not mistaken, should block all the URLs that end with ".woff". However, this doesn't seem to be working. For example, if I go to http://www.skype.com/ all the web fonts are still being loaded, including this kind of URL: http://www.skypeassets.com/i/common/fonts/latin/segoe-ui-light-latin.woff

    For other websites, I've also tried adding this:

    https://ssl.gstatic.com/fonts/*
    http://themes.googleusercontent.com/static/fonts/*
    

    But these URLs are still being loaded.

    Any idea how to make it work?

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    osx - Disabling Arial in favour of Helvetica on Mac OS X (Safari)
  • Rich Bradshaw

    I'd really like to stop reading Arial online, when I have the lovely Helvetica installed. Unfortunately, many sites specify their font familys as "Arial", "Helvetica", sans-serif, which means that I get Arial rather than Helvetica.

    I had the idea to disable Arial and all it's cousins in Font Book, assuming this would work. Weirdly, this changes the font, but it still looks like Arial, albeit a different weight. These two images show the situation. (I've disabled Trebuchet MS to get this site to show the problem)

    Interestingly, the Question title is in Helvetica, but not the Nav bar or the other sections.

    Normal

    alt text

    Arial, Arial Black et al. disabled

    alt text

    As you can see, even with Arial disabled, it's still using a varient of it. Looking at the capital R in Rich is a quick test. This looks horrible on screen.

    I've tried actually deleting the Arial fonts from /Library/Fonts, but this doesn't seem to make a difference.

    Non Cocoa apps like Firefox don't have the same problem and respect the fact that Arial doesn't exist/is disabled.

    How do I stop Arial appearing?

    (EDIT, about a day later: Ah, seems that randomly it's started ignoring Arial when disabled. Didn't restart, it just decided to play nice...)


  • Related Answers
  • 8088

    In Activity Monitor, use Get Info on the browser you are using, and look at the open files:

    enter image description here

    That will show you where the font is being taken from. I suspect that the new technologies in Leopard/Snow Leopard to activate fonts on demand are what are causing Arial to come back, and without forcibly erasing all existance of it, I'm not sure what you can do. You could use an applescript to move arial out of the font library, then start your browser, and another applescript to close your browser then move arial back.

    Do note however that Browsers like Opera and Firefox can apply custom user styles (per-site built-in to opera), so you can easily override arial on sites you choose. I often restyle sites to use fonts I choose - very powerful and useful for typography nerds like us.

    Also if you want a brutal shotgun approach, use a bookmarklet (copy as an address and make a bookmark out of it, clicking it will test it on this page):

    javascript:void(document.body.style.fontFamily='helvetica!important')
    

    And back to Arial:

    javascript:void(document.body.style.fontFamily='arial!important')
    

    This bookmarklet is even more brutal, will change everything on a page to helvetica

    javascript:for(i=0;i<document.getElementsByTagName('*').length;i++){document.getElementsByTagName('*')[i].style.fontFamily='georgia'};return;
    

    And, as you may find something useful, the most comprehensive and useful guide on font management for OS X:

    http://www.jklstudios.com/misc/osxfonts.html

  • tj111

    If your using Firefox, you can go to Options->Content and click the Advanced button next to the font settings. From there, select Helvetica and the size you want, and de-select the checkbox saying "Allow pages to choose their own fonts instead of my selections above". From now on all pages will use Helvetica.