Adblock Solution for Safari 4 (Windows and Mac)
February 25, 2009 : Permalink :

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.
- 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. [↩]
Tags: 

February 26th, 2009 at 11:23 pm
Great tip, not hiding everything but it is a start
February 27th, 2009 at 12:39 am
thanks! greetings from germany
February 27th, 2009 at 8:18 am
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.
February 28th, 2009 at 5:48 am
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/
February 28th, 2009 at 5:49 am
Oh, forgot to say though that it's Mac-only
March 1st, 2009 at 12:38 am
Whats the adblock format used in SafariBlock? does it support whitelists?
March 3rd, 2009 at 6:57 am
http://code.google.com/p/safariblock/
SafariBlock is the best I've ever used.
March 5th, 2009 at 2:41 pm
It's not as effective as adblock in firefox, but still it works for most of the blocking!! Thanx
March 22nd, 2009 at 9:06 pm
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).
March 24th, 2009 at 4:20 pm
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?
March 27th, 2009 at 3:48 pm
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.
March 27th, 2009 at 10:39 pm
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.
April 12th, 2009 at 4:33 pm
@Fanboy
This is amazing. I'm recommending it to all of my friends. Keep up the good work.
May 6th, 2009 at 12:01 pm
What we need is a SafariAdBlock for Safari on Windows 2000/ME/2003/XP/Vista/.etc
June 8th, 2009 at 6:47 pm
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
June 12th, 2009 at 7:13 am
Fanboy's element hider trick works, thank you for the tip
June 26th, 2009 at 5:13 pm
[...] 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. [...]
August 14th, 2009 at 9:09 pm
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
August 22nd, 2009 at 4:15 pm
Thanks a lot !
September 2nd, 2009 at 3:32 pm
Works great for Yahoo Fantasy Sports. I hate ads while trying to manage team rosters. Thanks.
September 2nd, 2009 at 3:39 pm
Regarding Google Chrome and Iron browsers, follow this link to a great adblocker that WORKS.
http://www.adsweep.org/
September 28th, 2009 at 3:32 am
[...] – 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 [...]
October 7th, 2009 at 2:16 am
It work very fine with “Anuncios Google”. Mi Safari is free of Google Adds
October 11th, 2009 at 11:01 am
[...] – 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 [...]
October 26th, 2009 at 9:08 am
How can I add sites manualy to the css sheet?
October 26th, 2009 at 8:26 pm
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
November 20th, 2009 at 3:31 pm
Thank You!!!
December 4th, 2009 at 8:55 pm
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.
December 9th, 2009 at 7:30 pm
To disable flash ads, try ClickToFlash
December 15th, 2009 at 12:54 am
[...] – 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 [...]
December 25th, 2009 at 4:02 pm
great, works most of the time! thanks buddy
January 17th, 2010 at 5:27 pm
Works like a charm. Big thank you!
January 25th, 2010 at 5:41 am
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?
January 27th, 2010 at 1:29 am
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.
January 29th, 2010 at 9:08 am
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!
February 2nd, 2010 at 9:25 pm
[...] [Adblock Solution For Safari 4 (Windows And Mac)] http://opindian.com/blog/2009/02/25/adbl…) 사파리의 외부 CSS기능으로 광고차단을 해준다. 이것저것 설치하는게 싫은 [...]
February 15th, 2010 at 2:26 pm
[...] – 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 [...]
February 17th, 2010 at 5:24 pm
works like magic ! All the ads are gone..thanks a lot
February 20th, 2010 at 3:05 am
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.
February 23rd, 2010 at 11:56 am
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!
February 27th, 2010 at 1:31 pm
nice! worked instantly, no browser restart or anything! thanks so much, i'd say that you're an expert programmer!
March 2nd, 2010 at 10:38 pm
I'm using Safari 4.0.4 on Vista x64. And this works wonderfully. Thanks
March 9th, 2010 at 12:16 pm
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…
March 9th, 2010 at 12:16 pm
BTW – I forgot – thanks as it works perfectly and simply.
March 22nd, 2010 at 1:00 pm
Thanks you are my hero! Everything working fine without those annoying adds!
April 15th, 2010 at 12:39 am
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.
April 15th, 2010 at 9:27 pm
Try replacing your current .css file with Element Hider CSS file v3 and let me know if that resolves it for you.
April 15th, 2010 at 11:01 pm
It got the sidebar back but some ads suddenly show up on various sites. Better than nothing though, thanks again.
April 25th, 2010 at 3:31 pm
Excellent – Fanboy rocks!
April 28th, 2010 at 6:24 am
[...] 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: [...]
April 30th, 2010 at 12:49 am
Hi, thnx for the great tool. Do u know about some other add-ons/style sheets for safari? I couldn't find anything useful.
May 18th, 2010 at 5:21 pm
[...] 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 [...]
May 22nd, 2010 at 10:04 am
works in safari 4.0.5 too
thanks
June 9th, 2010 at 1:19 am
Thank you so much, it works a lot!!!!
June 9th, 2010 at 7:28 pm
Cool! So easy and so effective….thanks!
June 11th, 2010 at 11:03 pm
[...] 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 [...]
June 29th, 2010 at 10:08 am
this just plain doesn't work on some sites, such as neopets. help?
July 12th, 2010 at 4:03 pm
Works well. Thanks for sharing.
July 12th, 2010 at 12:03 pm
Works well. Thanks for sharing.