Stephen Pontes [.com]

CSS and HTML fun

Ad blocking in Safari with ad_blocking.css

6 comments

Safari has the ability to use a custom stylesheet to modify how you see content on the web. For example, if websites’ text are frequently too small for you to read you can modify a css file to override the text size setting for all websites to increase your text’s size. Unfortunately, most people haven’t heard of this feature.

This file, in addition to increasing text size, can block ads. Read on for the “how”.

my_ad_blocking.css

I can’t find the original source, but it could be from here or here. Not sure.

What I’ve done is edited this file throughout the past couple months as I visit various sites to include even more “rules” for ad blocking. I’m pretty sure I’ve killed off most facebook, myspace and google ads everywhere.

How to use

Save my_ad_blocking.css (updated on 6/28/09) to the following directory:

Home folder > Library > Safari

Then, in Safari, navigate to the Advanced tab of your preferences and select the my_ad_blocking.css file. Quit and relaunch Safari to experience web browsing without ads! (For the most part). Please link me to any sites you find that have ads that you’d like to remove in the comments of this post and I’ll do my best to keep the file updated!
Safari Preferences

Written by Stephen Pontes

April 25th, 2009 at 2:51 pm

Posted in General

6 Responses to 'Ad blocking in Safari with ad_blocking.css'

Subscribe to comments with RSS or TrackBack to 'Ad blocking in Safari with ad_blocking.css'.

  1. Thanks for the good work. Check out this site where a few ads still broke through—http://www.startribune.com/

    Doug Toft

    19 Jun 09 at 6:51 am

  2. How would I add this site which posts announcing banner ads that automatically drop down and obscure the top of the page where the navigation urls reside. You must first close the dropdown to get to the urls.

    aka-cdn-ns-adtechus.com

    found on classmates.com

    Thanks, works great everywhere else.

    scShaw

    scShaw

    28 Jun 09 at 9:00 am

  3. Updated the file – Couldn’t get all the ads removed for you Doug (wasn’t sure which “classifieds” you wanted to keep and whatnot).

    scShaw – I think I fixed your issue, but since I’m not a member of Classmates.com I can’t verify. Is that a flash ad? I blocked it and think it’ll work.

    Stephen Pontes

    28 Jun 09 at 1:34 pm

  4. I’m running Safari on Windows XP with Flash 10 and the flash blocking doesn’t seem to work for most of the sites I frequent including:

    http://espn.go.com/
    http://sportsillustrated.cnn.com/
    http://www.charlotteobserver.com/

    I also tried the click-to-activate method mentioned here:

    http://www.floppymoose.com/

    and that did not work.

    I’m wondering if this method does not work for Windows.

    Thanks for any advice!

    B-Man

    4 Aug 09 at 3:07 pm

  5. I haven’t tested this on Windows personally – your mileage may vary…if the other methods you linked to that rely on CSS ad blocking don’t work, mine probably won’t work either :/

    Best of luck in finding a fix, and please post back if you find anything that can help other Windows users!

    Stephen Pontes

    4 Aug 09 at 3:11 pm

  6. Thanks for keeping this file up to date, works great

    ScottNYC

    22 Sep 09 at 6:29 pm

Leave a Reply