«•»


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. []
  • http://awebslife.tumblr.com Kyle Webs

    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.

  • Zygimantas

    To disable flash ads, try ClickToFlash

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

  • http://twitter.com/meirbartal Meir Bar-Tal

    Great solution! Thanks for sharing such valuable masterpiece with the community!

  • john

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

  • http://bellesfemmes.blogg.no/ Celina

    Works like a charm. Big thank you!

  • entropiness

    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?

  • http://opindian.com/blog/ ahpatel

    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.

  • Jack

    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!

  • Pingback: 맥 사파리 광고차단 « It's Only the Beginning

  • Pingback: Did Yahoo add marketing software recently? | Affiliate Marketing Blog

  • hims2in2

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

  • Scott

    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.

  • PäRä

    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!

  • http://aero4basic.weebly.com/ Alex Addison

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

  • Luke

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

  • TJ In Phoenix

    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…

  • TJ In Phoenix

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

  • Patzy

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

  • http://seanhasablog.com/ mustardandranch

    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.

  • http://opindian.com/blog/ ahpatel

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

  • http://opindian.com/blog/ ahpatel

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

  • http://seanhasablog.com/ mustardandranch

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

  • derev

    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px}
    span.Apple-tab-span {white-space:pre}

    embed[type="application/x-shockwave-flash"][width="468"][height="60"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="728"][height="90"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="250"][height="250"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="336"][height="280"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="120"][height="600"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="300"][height="250"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="160"][height="600"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="240"][height="400"] {
    display: none !important;
    visibility: hidden !important;
    }

    iframe[width="120"][height="600"], a img[width="120"][height="600"],
    iframe[width="125"][height="600"], a img[width="125"][height="600"],
    iframe[width="150"][height="100"], a img[width="150"][height="100"],
    iframe[width="150"][height="600"], a img[width="150"][height="600"],
    iframe[width="160"][height="600"], a img[width="160"][height="600"],
    iframe[width="300"][height="250"], a img[width="300"][height="250"],
    iframe[width="336"][height="280"], a img[width="336"][height="280"],
    iframe[width="468"][height="60"], a img[width="468"][height="60"],
    iframe[width="470"][height="62"], a img[width="470"][height="62"],
    iframe[width="728"][height="90"], a img[width="728"][height="90"],
    iframe[width="730"][height="92"], a img[width="730"][height="92"],
    iframe[width="600"][height="120"], object[width="125"][height="300"],
    iframe[width="180"][height="150"],
    iframe[src*="/ad-"],
    iframe[src*="/ad."],
    iframe[src*="/ad/"],
    iframe[src*="/ad_"],
    iframe[src*="/ads"],
    iframe[src*="/adv"],
    iframe[src*="/adx"],
    iframe[src*=".ad"],
    iframe[src*="_Banner"],
    iframe[src*="BET365"],
    iframe[src*="/click"],
    iframe[src*="?click"],
    iframe[src*="googlesyndication"],
    iframe[src*="/google/"],
    iframe[src*="promos"],
    iframe[name="bsadframe"],
    iframe[id="adFrame"],
    iframe[id="splashFrame"],
    img[src*="/ad-"],
    img[src*="/ad."],
    img[src*="/ad/"],
    img[src*="/ad_"],
    img[src*="/ads"],
    img[src*="/adv"],
    img[src*="/adx"],
    img[src*="/click"],
    img[src*="?click"],
    img[src*="/toms_skyscraper_"],
    img[src$="images/logos/amazon_international.gif"],
    img[src*="freshmeat.net/button.gif"],
    img[src*="pic.geocities.com/images/"],
    img[src*="i.imdb.com/Vpics/"],
    img[src*="i.imdb.com/Photos/CMSIcons"],
    img[src*="/fastclick/"],
    img[src*="i.imdb.com/Icons/apix/"],
    img[src*="i.imdb.com/Icons/kpix/"],
    img[src*="i.imdb.com/apix/"],
    img[src*="sportsbybrooks.com/farkbutton.gif"],
    img[alt*="advert"],
    img[alt*="Click Here To Visit Our Sponsor"],
    a:link[href*="/ad-"] img,
    a:link[href*="/ad."] img,
    a:link[href*="/ad/"] img,
    a:link[href*="/ad_"] img,
    a:link[href*="/ads"] img,
    a:link[href*="/adv"] img,
    a:link[href*="/adx"] img,
    a:link[href*=".ad"] img,
    a:link[href*="/banner"] img,
    a:link[href*="/click.cgi"] img,
    a:link[href*="/clickcgi?"] img,
    a:link[href*="/clickover"] img,
    a:link[href*="/clickthr"] img,
    a:link[href*="/click-"] img,
    a:link[href*="=click"] img,
    a:link[href*="?click"] img,
    a:link[href*="/A="] img,
    table table table[width="346"][height="280"],
    table[id="RefAd"],
    table[cellspacing="0"][width="160"][height="329"][bgcolor="#000000"],
    table[cellpadding="5"][width="150"][style="border: 1px dashed rgb(221, 170, 170); background-color: rgb(236, 248, 255);"],
    table[border="0"][cellpadding="3"][cellspacing="0"][height="40"][width="100%"],
    table[border="0"][cellpadding="0"][cellspacing="4"][align="right"][width="20%"],
    table[border="2"] td[valign="top"][bgcolor="#ffffff"] table[width="138"],
    table[border="0"][cellpadding="1"][cellspacing="0"][width="626"][bgcolor="#6699cc"],
    table[bordercolor="red"][height="225"][cellspacing="0"][cellpadding="0"][width="190"][bgcolor="white"][border="0"],
    table[width="336"][border="0"][cellspacing="0"][cellpadding="0"][align="right"][style="margin-left: 10px; margin-bottom: 10px;"],
    table[width="770"][border="0"] tr[valign="top"]
    td[width="160"],
    td[class="cnnNavAd"],
    td[style="border-bottom: 1px solid rgb(204, 204, 204); padding: 7px 3px; background-color: rgb(255, 254, 249);"],
    td span[class="aoltextad"],
    form[name="frmLargeForm"],
    form[action*="click_lx.cgi"],
    form[action^="http://rd.yahoo.com/"],
    form[action=""][name$="SoapCity"],
    form[action=""][name^="728x90"],
    form[action=""][name^="300x250"],
    form[method="get"][action*="martindale"][name="MDH"],
    embed[type="application/x-shockwave-flash"][src*="_Banner"],
    embed[type="application/x-shockwave-flash"][src*="/ad"],
    embed[type="application/x-shockwave-flash"][href*="/ad"],
    embed[type="application/x-shockwave-flash"][src*=".ad"],
    embed[type="application/x-shockwave-flash"][href*=".ad"],
    embed[type="application/x-shockwave-flash"][src*="?click"],
    embed[type="application/x-shockwave-flash"][src*="/us.yimg.com/a/"],
    embed[type="application/x-shockwave-flash"][href*="?click"],
    embed[type="application/x-shockwave-flash"][src*="/click"],
    embed[type="application/x-shockwave-flash"][href*="/click"],
    embed[type="application/x-shockwave-flash"][src*="promos"],
    embed[type="application/x-shockwave-flash"][href*="promos"],
    embed[type="application/x-shockwave-flash"][href*="=click"],
    embed[type="application/x-shockwave-flash"][href*="redirect"],
    embed[type="application/x-shockwave-flash"][href*="/A="],
    embed[type="application/x-shockwave-flash"][name*="advert"],
    embed[type="application/x-shockwave-flash"][name*="banner"],
    embed[type="application/x-shockwave-flash"][width="728"][height="90"],
    embed[type="application/x-shockwave-flash"][width="468"][height="60"],
    div[id*="advert"],
    div[id="dropin"],
    div[id="dwindow"],
    div[id="dcv_EchangeLay"],
    div[id="mntl"],
    div[id*="popup"],
    div[id="quack"],
    div[id="splashLayer"],
    div[id*="sponsor"],
    div[style="border: 1px solid rgb(221, 221, 221); padding: 5px; background-color: rgb(255, 255, 255);"],
    object[id="widgeth"],
    *[class="ad"],
    *[name*="klipad"],
    *[style*="/ads/"],
    *[id*="popover_"],
    *[src*="120x80"],
    *[src*="140x"],
    *[src*="?ad"],
    *[src*="-ad-"],
    *[src*="/adimage"],
    *[src*="adimg"],
    *[src*="advert"],
    *[src*="=click"],
    *[src*="banners."],
    *[src*="/images/dinkus/more-arrow-lo.gif"],
    *[src*="/javaImages/ec/"],
    *[src*="/offer"],
    *[src*="/puffboxes/"],
    *[src*="/sponsors/"],
    *[src*="_sponsor_"],
    *[src*="/us.yimg.com/a/ya"],
    *[src*=".adbutler.de"],
    *[src*=".nedstatbasic.net"],
    *[src*=".tradedoubler.com"],
    *[src*=".travelocity./Sponsor_gifs/"],
    *[src*="a.consumer.net"],
    *[src*="bannermania.nom.pl"],
    *[src*="cash4banner.com"],
    *[src*="crazypopups.com"],
    *[src*="hit-now.com"],
    *[src*="hitbox.com"],
    *[src*="img.thebugs.ws"],
    *[src*="kinghost.com/ban/"],
    *[src*="klipmart"],
    *[src*="popupad.net/ats/"],
    *[src*="public"][src*="ad"],
    *[src*="/publicidad/"],
    *[src*="qkimg.net"],
    *[src*="qksrv.net"],
    *[src*="rcm-images.amazon.com"],
    *[src*="rcm.amazon.com"],
    *[src*="salon.com/Creatives"],
    *[src*="sexcounter."],
    *[src*="sideads/"],
    *[src*="statse.webtrendslive.com"],
    *[href*="logging.to"],
    *[href*="/referral/"],
    *[href*="tryaol"],
    *[href*="websponsors"],
    *[src*="banman.asp"],
    *[href*="banman.asp"],
    *[src*="bannerman"],
    *[href*="bannerman"],
    *[src*="?banner"],
    *[href*="?banner"],
    *[src*="/banner/"],
    *[href*="/banner/"],
    *[src*="/banners/"],
    *[href*="/banners/"],
    *[src*="/jump/"],
    *[href*="/jump/"],
    *[src*="adfarm"],
    *[href*="adfarm"],
    *[src*="advertising.com"],
    *[href*="advertising.com"],
    *[src*="ar.atwola.com"],
    *[href*="ar.atwola.com"],
    *[src*="atdmt.com"],
    *[href*="atdmt.com"],
    *[src*="bluestreak.com"],
    *[href*="bluestreak.com"],
    *[src*="doubleclick"],
    *[href*="doubleclick"],
    *[src*="falkag.net"],
    *[href*="falkag.net"],
    *[src*="fastclick.com"],
    *[href*="fastclick.com"],
    *[src*="mediaplex"],
    *[href*="mediaplex"],
    *[src*="netdirect.nl"],
    *[href*="netdirect.nl"],
    *[src*="spinbox."],
    *[href*="spinbox."],
    *[src*="transfer.go"],
    *[href*="transfer.go"],
    *[src*=".tribalfusion"],
    *[href*=".tribalfusion"],
    *[src*="valueclick"],
    *[href*="valueclick"],
    *[src*="http://216.92.211.171/"],
    *[href*="http://216.92.211.171/"],
    *[src*="http://216.92.21.16/"],
    *[href*="http://216.92.21.16/"] {
    Â Â Â Â display: none !important;
    }

    img[src*="/click_"],
    img[src*="/cnn/images/clickability/"],
    img[src$="/banners/com000.jpg"],
    a:link[href*=".add"] img,
    a:link[href*="admin"] img,
    a:link[href*="adobe"] img,
    a:link[href*=".adp"] img,
    a:link[href*="click.mp3"] img,
    a:link[href*="/imgres?imgurl="] img,
    a:link[href*=":head"] img,
    a:link[href*="http://nettracker."] img,
    embed[type="application/x-shockwave-flash"][src*="gallery"] {
    Â Â Â Â display: inline !important;
    }

    /* Hide Google Ads */
    #ad { display: none; }

    iframe[name=Ógoogle_ads_frameÓ] {display: none !important;}

    /*
    #rh {
    display: none;
    }
    */

    #adhtml {
    display: none;
    }

    /* turning some false positives back off */
    A:link[HREF*="download."] IMG { display: inline !important; }
    A:link[HREF*="click.mp3"] IMG { display: inline !important; }
    A:link[HREF*="beatnikpad."] IMG { display: inline !important; }
    A:link[HREF*="newthread."] IMG { display: inline !important; }
    A:link[HREF*="typepad"] IMG { display: inline !important; }
    A:link[HREF*="clickz"] IMG { display: inline !important; }
    A:link[HREF*="akamai.net"] IMG { display : inline !important; }
    IMG[SRC*="akamai.net"] { display :inline !important; }
    A:link[HREF*="funmac.com"] img { display: inline !important; }

    /* Make e-mail and javascript links look different. */
    /*a[href^="mailto:"]:before { content: “2709 “; }
    a[href^="javascript:"] { color: green !important; }*/

    a[href*="goatse.cx"], a[href*="tubgirl.com"], a[href="rotton.com"] {
    text-decoration: line-through !important;
    color: brown !important;
    }

    /* Hide reset buttons */
    input[type="reset"], button[type="reset"] { display: none; }

    /* mozillazine, slashdot, etc */
    /* textarea { min-height: 380px; font-family: verdana, sans-serif } */
    /* Ignore effect of blink and marquee tags, but don’t hide their contents */
    blink { text-decoration: none !important; }

    /* marquee { -moz-binding: none ! important } */

    #notice {
    display: none;
    }

    /* block Yahoo sponsorship ads */
    .ovt { display: none !important; }

    /* block CNN contextual ads */
    #contextualLinks { display: none !important; }

    /* Tribe ads */
    DIV[CLASS*="OAS"] { display: none ! important }
    DIV[CLASS="adBrite"] { display: none ! important }
    DIV[CLASS=*"googleAd"] { display: none ! important }

    /* MySpace ads */
    *[ID="sponsoredLinksRight"] { display: none ! important; } /* remove right-side sponsored links in search results */
    table[bgcolor="ecf5fa"] { display: none ! important; } /* remove sponsored links in search results */
    iframe[src*="mspaceads.com"] { display: none ! important; }
    *[ID="ctl00_cpMain_MarketingBox_Skin_userHomeTabs_userHomeTabs"] { display: none ! important; } /* remove right-side annoying shit on home page */
    *[ID="ad-wrap"] { display: none ! important; } /* remove ads at bottom of search page */
    *[ID="marketingcontent"] { display: none ! important; } /* remove right-side annoying shit on home page */
    *[ID="featureWrap"] { display: none ! important; } /* remove right-side annoying shit on home page */
    *[ID="googlead"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="tkn_west"] { display: none ! important; } /* remove right-side google ad on login page */
    *[ID="tkn_east"] { display: none ! important; } /* remove right-side google ad on login page */
    *[ID="ctl00_Main_SplashDisplay_music_CMS_MyspaceSpecials"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="ctl00_Main_SplashDisplay_music_CMS_SplashHome_Gads_B"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="ctl00_Main_SplashDisplay_music_CMS_MyspaceMusic"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="Main_SplashDisplay_gettingStarted_getstarted"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="splash_mainBottom"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="SponsorViewTrackingUrl"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="ctl00_Main_SplashDisplay_PromoMember_ABIContainer"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="splash_coolNewPeople"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="ctl00_Main_SplashDisplay_featuredVideos_CMS_videos"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="splash_music"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="splash_mainLeft"] { display: none ! important; } /* remove right-side google ad on home page */

    /* MarinIJ ads */
    *[CLASS="lnbbgcolor"] { display: none ! important; } /* remove bottom Sponsored Links */
    *[CLASS="adElement"] { display: none ! important; } /* remove right side ads */
    *[CLASS="region5"] { display: none ! important; } /* remove right side ads */
    *[CLASS="articleEmbeddedAdBox"]Â { display: none ! important; } /* remove right side ads */

    /* News.com.au ads */
    *[ID="promoIslandRight"] { display: none ! important; } /* inline ad */

    /* Slashdot */
    /*
    *[CLASS="ad"*] { display: none ! important }
    *[CLASS="aduserbox"] { display: none ! important }
    *[CLASS="fad6"] { display: none ! important }
    */

    /* Flickr ads */
    DIV[CLASS*="AdBlock"] { display: none ! important }

    /* SFGate ads */
    DIV[ID="groupmenu"] { display: none ! important }
    DIV[ID="topjobs"] { display: none ! important }
    DIV[ID="topautos"] { display: none ! important }
    DIV[ID="adpos2"] { display: none ! important }
    DIV[ID="adpos4"] { display: none ! important }

    /* Facebook ads */
    [CLASS*="social_ad"] { display: none ! important; } /* remove right side ads */
    [CLASS*="ad_capsule"] { display: none ! important; }
    [ID*="app2558160538_VE_banner"] { display: none ! important; }
    [CLASS*="sidebar_item sponsor"] { display: none ! important; } /* remove right side ads */
    [CLASS*="sidebar_item invitefriends"] { display: none ! important; } /* remove right side ads */

    /* tv.com ads */
    [CLASS*="bwp"] { display: none ! important; }

    /* eBay ads */
    [CLASS*="yahooBtmAd"] { display: none ! important; }

    /* IMDB ads */
    /*DIV[CLASS*="listing"] { display: none ! important; }*/

    /* OkCupid ads */
    [CLASS*="blue ad element"] { display: none ! important; }
    [ID*="ad_wrap"] { display: none ! important; }

  • derev

    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px}
    span.Apple-tab-span {white-space:pre}

    embed[type="application/x-shockwave-flash"][width="468"][height="60"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="728"][height="90"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="250"][height="250"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="336"][height="280"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="120"][height="600"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="300"][height="250"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="160"][height="600"] {
    display: none !important;
    visibility: hidden !important;
    }

    embed[type="application/x-shockwave-flash"][width="240"][height="400"] {
    display: none !important;
    visibility: hidden !important;
    }

    iframe[width="120"][height="600"], a img[width="120"][height="600"],
    iframe[width="125"][height="600"], a img[width="125"][height="600"],
    iframe[width="150"][height="100"], a img[width="150"][height="100"],
    iframe[width="150"][height="600"], a img[width="150"][height="600"],
    iframe[width="160"][height="600"], a img[width="160"][height="600"],
    iframe[width="300"][height="250"], a img[width="300"][height="250"],
    iframe[width="336"][height="280"], a img[width="336"][height="280"],
    iframe[width="468"][height="60"], a img[width="468"][height="60"],
    iframe[width="470"][height="62"], a img[width="470"][height="62"],
    iframe[width="728"][height="90"], a img[width="728"][height="90"],
    iframe[width="730"][height="92"], a img[width="730"][height="92"],
    iframe[width="600"][height="120"], object[width="125"][height="300"],
    iframe[width="180"][height="150"],
    iframe[src*="/ad-"],
    iframe[src*="/ad."],
    iframe[src*="/ad/"],
    iframe[src*="/ad_"],
    iframe[src*="/ads"],
    iframe[src*="/adv"],
    iframe[src*="/adx"],
    iframe[src*=".ad"],
    iframe[src*="_Banner"],
    iframe[src*="BET365"],
    iframe[src*="/click"],
    iframe[src*="?click"],
    iframe[src*="googlesyndication"],
    iframe[src*="/google/"],
    iframe[src*="promos"],
    iframe[name="bsadframe"],
    iframe[id="adFrame"],
    iframe[id="splashFrame"],
    img[src*="/ad-"],
    img[src*="/ad."],
    img[src*="/ad/"],
    img[src*="/ad_"],
    img[src*="/ads"],
    img[src*="/adv"],
    img[src*="/adx"],
    img[src*="/click"],
    img[src*="?click"],
    img[src*="/toms_skyscraper_"],
    img[src$="images/logos/amazon_international.gif"],
    img[src*="freshmeat.net/button.gif"],
    img[src*="pic.geocities.com/images/"],
    img[src*="i.imdb.com/Vpics/"],
    img[src*="i.imdb.com/Photos/CMSIcons"],
    img[src*="/fastclick/"],
    img[src*="i.imdb.com/Icons/apix/"],
    img[src*="i.imdb.com/Icons/kpix/"],
    img[src*="i.imdb.com/apix/"],
    img[src*="sportsbybrooks.com/farkbutton.gif"],
    img[alt*="advert"],
    img[alt*="Click Here To Visit Our Sponsor"],
    a:link[href*="/ad-"] img,
    a:link[href*="/ad."] img,
    a:link[href*="/ad/"] img,
    a:link[href*="/ad_"] img,
    a:link[href*="/ads"] img,
    a:link[href*="/adv"] img,
    a:link[href*="/adx"] img,
    a:link[href*=".ad"] img,
    a:link[href*="/banner"] img,
    a:link[href*="/click.cgi"] img,
    a:link[href*="/clickcgi?"] img,
    a:link[href*="/clickover"] img,
    a:link[href*="/clickthr"] img,
    a:link[href*="/click-"] img,
    a:link[href*="=click"] img,
    a:link[href*="?click"] img,
    a:link[href*="/A="] img,
    table table table[width="346"][height="280"],
    table[id="RefAd"],
    table[cellspacing="0"][width="160"][height="329"][bgcolor="#000000"],
    table[cellpadding="5"][width="150"][style="border: 1px dashed rgb(221, 170, 170); background-color: rgb(236, 248, 255);"],
    table[border="0"][cellpadding="3"][cellspacing="0"][height="40"][width="100%"],
    table[border="0"][cellpadding="0"][cellspacing="4"][align="right"][width="20%"],
    table[border="2"] td[valign="top"][bgcolor="#ffffff"] table[width="138"],
    table[border="0"][cellpadding="1"][cellspacing="0"][width="626"][bgcolor="#6699cc"],
    table[bordercolor="red"][height="225"][cellspacing="0"][cellpadding="0"][width="190"][bgcolor="white"][border="0"],
    table[width="336"][border="0"][cellspacing="0"][cellpadding="0"][align="right"][style="margin-left: 10px; margin-bottom: 10px;"],
    table[width="770"][border="0"] tr[valign="top"]
    td[width="160"],
    td[class="cnnNavAd"],
    td[style="border-bottom: 1px solid rgb(204, 204, 204); padding: 7px 3px; background-color: rgb(255, 254, 249);"],
    td span[class="aoltextad"],
    form[name="frmLargeForm"],
    form[action*="click_lx.cgi"],
    form[action^="http://rd.yahoo.com/"],
    form[action=""][name$="SoapCity"],
    form[action=""][name^="728x90"],
    form[action=""][name^="300x250"],
    form[method="get"][action*="martindale"][name="MDH"],
    embed[type="application/x-shockwave-flash"][src*="_Banner"],
    embed[type="application/x-shockwave-flash"][src*="/ad"],
    embed[type="application/x-shockwave-flash"][href*="/ad"],
    embed[type="application/x-shockwave-flash"][src*=".ad"],
    embed[type="application/x-shockwave-flash"][href*=".ad"],
    embed[type="application/x-shockwave-flash"][src*="?click"],
    embed[type="application/x-shockwave-flash"][src*="/us.yimg.com/a/"],
    embed[type="application/x-shockwave-flash"][href*="?click"],
    embed[type="application/x-shockwave-flash"][src*="/click"],
    embed[type="application/x-shockwave-flash"][href*="/click"],
    embed[type="application/x-shockwave-flash"][src*="promos"],
    embed[type="application/x-shockwave-flash"][href*="promos"],
    embed[type="application/x-shockwave-flash"][href*="=click"],
    embed[type="application/x-shockwave-flash"][href*="redirect"],
    embed[type="application/x-shockwave-flash"][href*="/A="],
    embed[type="application/x-shockwave-flash"][name*="advert"],
    embed[type="application/x-shockwave-flash"][name*="banner"],
    embed[type="application/x-shockwave-flash"][width="728"][height="90"],
    embed[type="application/x-shockwave-flash"][width="468"][height="60"],
    div[id*="advert"],
    div[id="dropin"],
    div[id="dwindow"],
    div[id="dcv_EchangeLay"],
    div[id="mntl"],
    div[id*="popup"],
    div[id="quack"],
    div[id="splashLayer"],
    div[id*="sponsor"],
    div[style="border: 1px solid rgb(221, 221, 221); padding: 5px; background-color: rgb(255, 255, 255);"],
    object[id="widgeth"],
    *[class="ad"],
    *[name*="klipad"],
    *[style*="/ads/"],
    *[id*="popover_"],
    *[src*="120x80"],
    *[src*="140x"],
    *[src*="?ad"],
    *[src*="-ad-"],
    *[src*="/adimage"],
    *[src*="adimg"],
    *[src*="advert"],
    *[src*="=click"],
    *[src*="banners."],
    *[src*="/images/dinkus/more-arrow-lo.gif"],
    *[src*="/javaImages/ec/"],
    *[src*="/offer"],
    *[src*="/puffboxes/"],
    *[src*="/sponsors/"],
    *[src*="_sponsor_"],
    *[src*="/us.yimg.com/a/ya"],
    *[src*=".adbutler.de"],
    *[src*=".nedstatbasic.net"],
    *[src*=".tradedoubler.com"],
    *[src*=".travelocity./Sponsor_gifs/"],
    *[src*="a.consumer.net"],
    *[src*="bannermania.nom.pl"],
    *[src*="cash4banner.com"],
    *[src*="crazypopups.com"],
    *[src*="hit-now.com"],
    *[src*="hitbox.com"],
    *[src*="img.thebugs.ws"],
    *[src*="kinghost.com/ban/"],
    *[src*="klipmart"],
    *[src*="popupad.net/ats/"],
    *[src*="public"][src*="ad"],
    *[src*="/publicidad/"],
    *[src*="qkimg.net"],
    *[src*="qksrv.net"],
    *[src*="rcm-images.amazon.com"],
    *[src*="rcm.amazon.com"],
    *[src*="salon.com/Creatives"],
    *[src*="sexcounter."],
    *[src*="sideads/"],
    *[src*="statse.webtrendslive.com"],
    *[href*="logging.to"],
    *[href*="/referral/"],
    *[href*="tryaol"],
    *[href*="websponsors"],
    *[src*="banman.asp"],
    *[href*="banman.asp"],
    *[src*="bannerman"],
    *[href*="bannerman"],
    *[src*="?banner"],
    *[href*="?banner"],
    *[src*="/banner/"],
    *[href*="/banner/"],
    *[src*="/banners/"],
    *[href*="/banners/"],
    *[src*="/jump/"],
    *[href*="/jump/"],
    *[src*="adfarm"],
    *[href*="adfarm"],
    *[src*="advertising.com"],
    *[href*="advertising.com"],
    *[src*="ar.atwola.com"],
    *[href*="ar.atwola.com"],
    *[src*="atdmt.com"],
    *[href*="atdmt.com"],
    *[src*="bluestreak.com"],
    *[href*="bluestreak.com"],
    *[src*="doubleclick"],
    *[href*="doubleclick"],
    *[src*="falkag.net"],
    *[href*="falkag.net"],
    *[src*="fastclick.com"],
    *[href*="fastclick.com"],
    *[src*="mediaplex"],
    *[href*="mediaplex"],
    *[src*="netdirect.nl"],
    *[href*="netdirect.nl"],
    *[src*="spinbox."],
    *[href*="spinbox."],
    *[src*="transfer.go"],
    *[href*="transfer.go"],
    *[src*=".tribalfusion"],
    *[href*=".tribalfusion"],
    *[src*="valueclick"],
    *[href*="valueclick"],
    *[src*="http://216.92.211.171/"],
    *[href*="http://216.92.211.171/"],
    *[src*="http://216.92.21.16/"],
    *[href*="http://216.92.21.16/"] {
    Â Â Â Â display: none !important;
    }

    img[src*="/click_"],
    img[src*="/cnn/images/clickability/"],
    img[src$="/banners/com000.jpg"],
    a:link[href*=".add"] img,
    a:link[href*="admin"] img,
    a:link[href*="adobe"] img,
    a:link[href*=".adp"] img,
    a:link[href*="click.mp3"] img,
    a:link[href*="/imgres?imgurl="] img,
    a:link[href*=":head"] img,
    a:link[href*="http://nettracker."] img,
    embed[type="application/x-shockwave-flash"][src*="gallery"] {
    Â Â Â Â display: inline !important;
    }

    /* Hide Google Ads */
    #ad { display: none; }

    iframe[name=Ógoogle_ads_frameÓ] {display: none !important;}

    /*
    #rh {
    display: none;
    }
    */

    #adhtml {
    display: none;
    }

    /* turning some false positives back off */
    A:link[HREF*="download."] IMG { display: inline !important; }
    A:link[HREF*="click.mp3"] IMG { display: inline !important; }
    A:link[HREF*="beatnikpad."] IMG { display: inline !important; }
    A:link[HREF*="newthread."] IMG { display: inline !important; }
    A:link[HREF*="typepad"] IMG { display: inline !important; }
    A:link[HREF*="clickz"] IMG { display: inline !important; }
    A:link[HREF*="akamai.net"] IMG { display : inline !important; }
    IMG[SRC*="akamai.net"] { display :inline !important; }
    A:link[HREF*="funmac.com"] img { display: inline !important; }

    /* Make e-mail and javascript links look different. */
    /*a[href^="mailto:"]:before { content: “2709 “; }
    a[href^="javascript:"] { color: green !important; }*/

    a[href*="goatse.cx"], a[href*="tubgirl.com"], a[href="rotton.com"] {
    text-decoration: line-through !important;
    color: brown !important;
    }

    /* Hide reset buttons */
    input[type="reset"], button[type="reset"] { display: none; }

    /* mozillazine, slashdot, etc */
    /* textarea { min-height: 380px; font-family: verdana, sans-serif } */
    /* Ignore effect of blink and marquee tags, but don’t hide their contents */
    blink { text-decoration: none !important; }

    /* marquee { -moz-binding: none ! important } */

    #notice {
    display: none;
    }

    /* block Yahoo sponsorship ads */
    .ovt { display: none !important; }

    /* block CNN contextual ads */
    #contextualLinks { display: none !important; }

    /* Tribe ads */
    DIV[CLASS*="OAS"] { display: none ! important }
    DIV[CLASS="adBrite"] { display: none ! important }
    DIV[CLASS=*"googleAd"] { display: none ! important }

    /* MySpace ads */
    *[ID="sponsoredLinksRight"] { display: none ! important; } /* remove right-side sponsored links in search results */
    table[bgcolor="ecf5fa"] { display: none ! important; } /* remove sponsored links in search results */
    iframe[src*="mspaceads.com"] { display: none ! important; }
    *[ID="ctl00_cpMain_MarketingBox_Skin_userHomeTabs_userHomeTabs"] { display: none ! important; } /* remove right-side annoying shit on home page */
    *[ID="ad-wrap"] { display: none ! important; } /* remove ads at bottom of search page */
    *[ID="marketingcontent"] { display: none ! important; } /* remove right-side annoying shit on home page */
    *[ID="featureWrap"] { display: none ! important; } /* remove right-side annoying shit on home page */
    *[ID="googlead"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="tkn_west"] { display: none ! important; } /* remove right-side google ad on login page */
    *[ID="tkn_east"] { display: none ! important; } /* remove right-side google ad on login page */
    *[ID="ctl00_Main_SplashDisplay_music_CMS_MyspaceSpecials"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="ctl00_Main_SplashDisplay_music_CMS_SplashHome_Gads_B"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="ctl00_Main_SplashDisplay_music_CMS_MyspaceMusic"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="Main_SplashDisplay_gettingStarted_getstarted"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="splash_mainBottom"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="SponsorViewTrackingUrl"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="ctl00_Main_SplashDisplay_PromoMember_ABIContainer"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="splash_coolNewPeople"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="ctl00_Main_SplashDisplay_featuredVideos_CMS_videos"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="splash_music"] { display: none ! important; } /* remove right-side google ad on home page */
    *[ID="splash_mainLeft"] { display: none ! important; } /* remove right-side google ad on home page */

    /* MarinIJ ads */
    *[CLASS="lnbbgcolor"] { display: none ! important; } /* remove bottom Sponsored Links */
    *[CLASS="adElement"] { display: none ! important; } /* remove right side ads */
    *[CLASS="region5"] { display: none ! important; } /* remove right side ads */
    *[CLASS="articleEmbeddedAdBox"]Â { display: none ! important; } /* remove right side ads */

    /* News.com.au ads */
    *[ID="promoIslandRight"] { display: none ! important; } /* inline ad */

    /* Slashdot */
    /*
    *[CLASS="ad"*] { display: none ! important }
    *[CLASS="aduserbox"] { display: none ! important }
    *[CLASS="fad6"] { display: none ! important }
    */

    /* Flickr ads */
    DIV[CLASS*="AdBlock"] { display: none ! important }

    /* SFGate ads */
    DIV[ID="groupmenu"] { display: none ! important }
    DIV[ID="topjobs"] { display: none ! important }
    DIV[ID="topautos"] { display: none ! important }
    DIV[ID="adpos2"] { display: none ! important }
    DIV[ID="adpos4"] { display: none ! important }

    /* Facebook ads */
    [CLASS*="social_ad"] { display: none ! important; } /* remove right side ads */
    [CLASS*="ad_capsule"] { display: none ! important; }
    [ID*="app2558160538_VE_banner"] { display: none ! important; }
    [CLASS*="sidebar_item sponsor"] { display: none ! important; } /* remove right side ads */
    [CLASS*="sidebar_item invitefriends"] { display: none ! important; } /* remove right side ads */

    /* tv.com ads */
    [CLASS*="bwp"] { display: none ! important; }

    /* eBay ads */
    [CLASS*="yahooBtmAd"] { display: none ! important; }

    /* IMDB ads */
    /*DIV[CLASS*="listing"] { display: none ! important; }*/

    /* OkCupid ads */
    [CLASS*="blue ad element"] { display: none ! important; }
    [ID*="ad_wrap"] { display: none ! important; }

  • Cattychick

    Excellent – Fanboy rocks!

  • Pingback: How to block email ads?

  • Nibir Farhan

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

  • Pingback: frage zu safari 4 - WinBoard - Die Windows Community

  • Martie

    works in safari 4.0.5 too
    thanks :)

  • Pierre_ksp

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

  • Sean

    Cool! So easy and so effective….thanks!

  • Pingback: More on ad blockers … @ The Paepae

  • Bella Night

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

  • http://www.facebook.com/pothi.kalimuthu Pothi Kalimuthu

    Works well. Thanks for sharing.

  • http://www.facebook.com/pothi.kalimuthu Pothi Kalimuthu

    Works well. Thanks for sharing.

  • http://www.facebook.com/people/Christopher-Sharp/616241135 Christopher Sharp

    Works perfectly for some sites I use :) Just now I need to figure out how to sort the pop up blocker cause its on and doing nothing!

  • Kool-aid

    THANK YOU soo much…thanks to u now i kan watch videos without having those ads making noise…GOD i hate them

    • Gyjan

      Mee too.:D

  • Pingback: Q&A: How do I eliminate the annoying Netflix pop-up ads on my new iMac with Safari? « Unlock the Power of your iPhone, iPod, iMac!