«•»


Adblock Solution for Safari 4 (Windows and Mac)

Date February 25, 2009 : Permalink :

Safari Adblock

Update: Works in Safari 5 as well.

While there isn’t a native Ad Blocker in Safari 4, I was able to clean up most websites by using Fanboy’s Element Hider stylesheet1 to collapse the advertisement elements.

Here are the steps to setting up the Advertisement Hider in Safari 4:

Step 1: Download Fanboy’s Element Hider CSS file and save it to the Safari profile (or any folder of your choosing).

Step 2: Launch Safari4, go to Preferences -> Advanced -> Style Sheet -> Other… and select the fanboy-adblocklist-elements.css file you just saved.

Note: I am aware of 3rd party tools like Proximity to block ads but I prefer using a browser-specific solution. If you have a better way of handling ads in Safari, please share your ideas in the comments.

  1. The Element Hider is part of an excellent, lightweight Adblock List maintained by Fanboy and available for Opera (my primary browser).  It is made up of two parts: (1) a urlfilter.ini replacement file that catches the ads before they are loaded and (2) an element hider .css file that colapses the ad space so that the webpage looks cleaner. []

View Comments to “Adblock Solution for Safari 4 (Windows and Mac)”

  1. Yinchie said:

    Great tip, not hiding everything but it is a start :)

  2. tom said:

    thanks! greetings from germany

  3. Fanboy said:

    Yinchie, Probably never hide everything, you can only do so much with css. However if Safari had an proper url blocker extension (supporting both Windows/OSX), then I'd openly support it.

  4. Cameron said:

    SafariBlock is working great for me in Safari 4 beta. It adds a panel to your Safari preferences, supporting block lists as well as manually adding entries (either by right-clicking on an image or by typing it in).
    http://code.google.com/p/safariblock/

  5. Cameron said:

    Oh, forgot to say though that it's Mac-only :-(

  6. Fanboy said:

    Whats the adblock format used in SafariBlock? does it support whitelists?

  7. Kevin said:

    http://code.google.com/p/safariblock/

    SafariBlock is the best I've ever used.

  8. Singh said:

    It's not as effective as adblock in firefox, but still it works for most of the blocking!! Thanx

  9. Joel said:

    http://glimmerblocker.org/ <— better than safariadblock. doesn't require any sort of inputmanager or simbl hacks, and is totally independent from browser version (ie, wont break when you upgrade safari).

  10. Kristopher LaGreca said:

    am I correct in guessing that scripts like this "hide" elements, but don't stop them from executing? So, Flash elements, for example, will still be taking up memory and CPU cycles, even if they don't display?

  11. ahpatel said:

    Correct. It is collapsing the advertising elements but not preventing them from being downloaded.

    On a Windows system, you would have to use a proxy solution or a modified hosts file to prevents ads from ever being downloaded. If you go the HOSTS route, I suggest http://someonewhocares.org/hosts/hosts

    The combination of the modified hosts file AND Fanboy's collapsed element hider is what makes the ads go away and keeps the websites looking well formatted.

  12. Kristopher LaGreca said:

    Thanks for the tip! Since I'm on a mac, I decided to use OpenDNS and add the most popular ad domains to my list. Let's see how that works.

  13. Jake Snyder said:

    @Fanboy

    This is amazing. I'm recommending it to all of my friends. Keep up the good work.

  14. Erik McDarby said:

    What we need is a SafariAdBlock for Safari on Windows 2000/ME/2003/XP/Vista/.etc

  15. soeschelz said:

    sorry,

    but all the posts about other adblockers are for the mac version.

    is there any other blocker for the windows version of safari 4.0?

    Thanks from Germany

  16. Yalin said:

    Fanboy's element hider trick works, thank you for the tip

  17. Safari 4: Is It Time To Switch From Firefox? | DodaPedia said:

    [...] Thanks to an AdBlock list and a CSS file designed for Opera by Fanboy you can now disable most of ads. All you have to do is download Element Hider CSS file and go to Preferences -> Advanced -> Style Sheet –> Other. Select the CSS file you just downloaded. Remember though that you’re undermining the revenue model for MakeUseOf and the writers behind it as well as other web publications. [...]

  18. techgeekz said:

    Thanks a lot… for me it worked like a charm:)

    I was a little skeptical at first but gave it a go and to my surprise some of the regular websites that I visit daily did show up ' clean ' to my relief..

    I am using Safari 4.0.2 on Win Vista

    Now if only there was one for Google Chrome..the only reason I am sticking to FireFox ( and now Safari after this tune-up ) is that Chrome does not have a supported Adblock Plus kind of a Program, there's one AdMuncher available but its paid and expensive for adblocking programme :(

  19. inket said:

    Thanks a lot !

  20. mw1862 said:

    Works great for Yahoo Fantasy Sports. I hate ads while trying to manage team rosters. Thanks.

  21. mw1862 said:

    Regarding Google Chrome and Iron browsers, follow this link to a great adblocker that WORKS.

    http://www.adsweep.org/

  22. i cannot stay on my email page for long as www.mcashcard.org/eif/urchin.html pops up and blocks me,what to do? | Popup Blog said:

    [...] – for Safari Mac http://opindian.com/blog/2009/02/25/adblock-solution-for-safari-4-windows-and-mac/ – another solution for Safari 4 Win and [...]

  23. Carlos said:

    It work very fine with “Anuncios Google”. Mi Safari is free of Google Adds

  24. PlaceMyProduct Blog said:

    [...] – for Safari Mac http://opindian.com/blog/2009/02/25/adblock-solution-for-safari-4-windows-and-mac/ – another solution for Safari 4 Win and [...]

  25. Silizium said:

    How can I add sites manualy to the css sheet?

  26. ahpatel said:

    You can manually add sites to the urlfilter.ini file, under the [exclude] section.

    Additionally, you can inform Fanboy of the missing sites on his forum

  27. Grateful Living said:

    Thank You!!!

  28. Kyle Webs said:

    Thanks for this post. It's not a great one, but it's okay for now. It doesn't block ads on YouTube videos, thats one of the biggest things I've noticed. When I used an Ad-blocker for firefox, it did that, and it also removed the space completely. This one just replaces it with a white box. But it's pretty good for now.

  29. Zygimantas said:

    To disable flash ads, try ClickToFlash

  30. How do I remove those irritating ads from the right side of my email page? | Irritating Smell said:

    [...] – for Safari Mac http://opindian.com/blog/2009/02/25/adblock-solution-for-safari-4-windows-and-mac/ – another solution for Safari 4 Win and [...]

  31. john said:

    great, works most of the time! thanks buddy :)

  32. Celina said:

    Works like a charm. Big thank you!

  33. entropiness said:

    Thanks, this works really well, but it's blocking some things that I don't want it to. For example, on Myspace, when you hover over your friends a box should pop-up where you can send them a message or a comment. Is there any way around this?

  34. ahpatel said:

    The easiest way to resolve it for good would be to inform the author of the adblocker script (via the Fanboy Forums) so it can be fixed in the next release.

  35. Jack said:

    http://pseudo-flaw.net/content/adblock/

    is adblocking immoral? piss off. Having to view them without choice is immoral!

    This is sweet – Google sponsored link are gone now!

  36. 맥 사파리 광고차단 « It's Only the Beginning said:

    [...] [Adblock Solution For Safari 4 (Windows And Mac)] http://opindian.com/blog/2009/02/25/adbl…) 사파리의 외부 CSS기능으로 광고차단을 해준다. 이것저것 설치하는게 싫은 [...]

  37. Did Yahoo add marketing software recently? | Affiliate Marketing Blog said:

    [...] – for Safari Mac http://opindian.com/blog/2009/02/25/adblock-solution-for-safari-4-windows-and-mac/ – another solution for Safari 4 Win and [...]

  38. hims2in2 said:

    works like magic ! All the ads are gone..thanks a lot :)

  39. Scott said:

    The ONE thing that's consistently kept me from using Safari, my favorite browser (Camino), and the rest, and finally landed me semi-permanently with Firefox, is lack of an ad blocking solution that doesn't require going into prefs, or restarting the browser every time i make a small change.

    For two different periods of time i attempted to use Privoxy, but it's UI, if you can even call it that, is the most user unfriendly load of garbage i've ever seen. It's focus is in the wrong place anyway.

  40. PäRä said:

    This is of major help, it blows firefox out of the water now with this. Ad's were the last thing annoying me with Safari, now this I enjoy thank you!

  41. Alex Addison said:

    nice! worked instantly, no browser restart or anything! thanks so much, i'd say that you're an expert programmer!

  42. Luke said:

    I'm using Safari 4.0.4 on Vista x64. And this works wonderfully. Thanks

  43. TJ In Phoenix said:

    If websites were more responsible with their ads and layout design, we wouldn't be forced to use tools like this. Facebook, MySpace, and the ZDNet pages are examples of poor ad placement and saturation. And, I don't care how many millions of hot chicks want to meat me in Fargo, ND…

  44. TJ In Phoenix said:

    BTW – I forgot – thanks as it works perfectly and simply.

  45. Patzy said:

    Thanks you are my hero! Everything working fine without those annoying adds!

  46. mustardandranch said:

    Everything works great so far except for some reason it hides everything in the sidebar on user profiles on Last.fm. Have a fix for that?

    Thanks.

  47. ahpatel said:

    Try replacing your current .css file with Element Hider CSS file v3 and let me know if that resolves it for you.

  48. mustardandranch said:

    It got the sidebar back but some ads suddenly show up on various sites. Better than nothing though, thanks again.

  49. Cattychick said:

    Excellent – Fanboy rocks!

  50. How to block email ads? said:

    [...] More options for you to find out on your own: http://www.lmgtfy.com/?q=opera+adblock Safari: Adblock Solution for Safari 4 (Windows and Mac) There's also userscripts that are able to block ads: [...]

  51. Nibir Farhan said:

    Hi, thnx for the great tool. Do u know about some other add-ons/style sheets for safari? I couldn't find anything useful.

  52. frage zu safari 4 - WinBoard - Die Windows Community said:

    [...] habe ja schon eine .css datei in safari drine die werbung blockieren soll nur was mit css file adblock-solution-for-safari-4-windows and mac [...]

  53. Martie said:

    works in safari 4.0.5 too
    thanks :)

  54. Pierre_ksp said:

    Thank you so much, it works a lot!!!!

  55. Sean said:

    Cool! So easy and so effective….thanks!

  56. More on ad blockers … @ The Paepae said:

    [...] with Safari 5.0, this is the very useful adblock list (css stylesheet) I’m using at present. Combined with Click2flash (which allows you to whitelist sites that [...]

  57. Bella Night said:

    this just plain doesn't work on some sites, such as neopets. help?

  58. Pothi Kalimuthu said:

    Works well. Thanks for sharing.

  59. Pothi Kalimuthu said:

    Works well. Thanks for sharing.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

blog comments powered by Disqus