User Name
Password
AppleNova Forums » Apple Products »

Safari ad blocking and _blank attribute


Register Members List Calendar Search FAQ Posting Guidelines
Safari ad blocking and _blank attribute
Thread Tools
arnoz
New Member
 
Join Date: Oct 2005
Location: Brussels
 
2006-05-23, 09:18

Hello,

I am a switcher and i am discovering Safari. I really like it (i thougt i would immediately install Firefox) but i have two questions:

1) I would like that every like that has the _blank attribute open in a new tab and NOT in a new window
2) What ad blocking do you use? In firefox (PC) i used the following code in a CSS. It worked pretty well and blocked really almost ad, image and flash. I read something about using this .css in Safari, it works for sure, but not perfectly... I can still see flash ads and some images
I also added some code at the end to allow two websites to display ads: Apple and my company's. But it doesn't work either, they're blocked.

So if you could help me providing me links or whatever, thanks!

PS: If it is possible to avoid plug-ins and app to install to work with safari, it would be even more cooler

Code:
/* * ad_blocking.css: general ad-blocking * Last Update: Thu Feb 16 13:38:51 CST 2006 * * http://www.gozer.org/mozilla/ad_blocking/ */ /* Stylish <http://forums.mozillazine.org/viewtopic.php?t=327735> (Gecko 1.8+) BEGIN: @-moz-document url-prefix(http) { */ /* --- primary -------------------------------------------------------------- */ /* images, plugins, iframes: general */ a[href*="/A="] img, *[src*="/A="], a[href*="/ad-"] img, *[src*="/ad-"], a[href*="/ads"] img, *[src*="/ads"], a[href*="/ads/"] img, *[src*="/ads/"], a[href*="/ad."] img, *[src*="/ad."], a[href*="/ad/"] img, *[src*="/ad/"], a[href*="/ad_"] img, *[src*="/ad_"], a[href*="/ads_"] img, *[src*="/ads_"], a[href*="/ads_/"] img, *[src*="/ads_/"], a[href*="/adv"] img, *[src*="/adv"], a[href*="/adx"] img, *[src*="/adx"], a[href*="_ad/"] img, *[src*="_ad/"], a[href*="_ad."] img, *[src*="_ad."], a[href*="-ad-"] img, *[src*="-ad-"], a[href*="?ad"] img, *[src*="?ad"], a[href*="/adbanners"] img, *[src*="/adbanners"], a[href*="/adserver."] img, *[src*="/adserver."], a[href*="/jump/"] img, *[src*="/jump/"], a[href*="?banner"] img, *[src*="?banner"], a[href*="/banner"] img, *[src*="/banner"], a[href*="/click-"] img, *[href*="/click-"], a[href*="=click"] img, *[src*="=click"], a[href*="?click"] img, *[src*="?click"], a[href*="click_"] img, *[src*="click_"], a[href*="click.php"] img, *[src*="click.php"], a[href*="adclick"] img, *[src*="adclick"], a[href*="adfarm"] img, *[src*="adfarm"], a[href*="adimage"] img, *[src*="adimage"], a[href*="adimg"] img, *[src*="adimg"], a[href*="advert"] img, *[src*="advert"], a[href*="/banner/"] img, *[src*="/banner/"], a[href*="/banners/"] img, *[src*="/banners/"], a[href*="banners."] img, *[src*="banners."], a[href*="banman"] img, *[src*="banman"], a[href*="bannerman"] img, *[src*="bannerman"] { display: none !important } /* images, plugins, iframes: domain-specific */ a[href*="ar.atwola.com"] img, *[src*="ar.atwola.com"], a[href*="atdmt.com"] img, *[src*="atdmt.com"], a[href*="bluestreak.com"] img, *[src*="bluestreak.com"], a[href*="doubleclick."] img, *[src*="doubleclick."], a[href*="tribalfusion.com"] img, *[src*="tribalfusion.com"], a[href*="fastclick."] img, *[src*="fastclick."], a[href*="logging.to"] img, *[src*="logging.to"], a[href*="mediaplex.com"] img, *[src*="mediaplex.com"], a[href*="industrybrains.com"] img, *[src*="industrybrains.com"], a[href*="spacetarget"] img, *[src*="spacetarget"], a[href*="spinbox."] img, *[src*="spinbox."], a[href*="transfer.go"] img, *[src*="transfer.go"], a[href*="valueclick."] img, *[src*="valueclick."], a[href*="linkexchange."] img, *[src*="linkexchange."], a[href*="smartclicks."] img, *[src*="smartclicks."], a[href*="nedstatbasic.net"] img, *[src*="nedstatbasic.net"], a[href*="tradedoubler.com"] img, *[src*="tradedoubler.com"], a[href*="adbutler."] img, *[src*="adbutler."], a[href*="a.consumer.net"] img, *[src*="a.consumer.net"], a[href*="cash4banner.com"] img, *[src*="cash4banner.com"], a[href*="crazypopups.com"] img, *[src*="crazypopups.com"], a[href*="hit-now.com"] img, *[src*="hit-now.com"], a[href*="hitbox.com"] img, *[src*="hitbox.com"], a[href*="qkimg.net"] img, *[src*="qkimg.net"], a[href*="qksrv.net"] img, *[src*="qksrv.net"], a[href*="popupad.net"] img, *[src*="popupad.net"], a[href*="bannermania.nom.pl"] img, *[src*="bannermania.nom.pl"], a[href*="rcm-images.amazon.com"] img, *[src*="rcm-images.amazon.com"], a[href*="rcm.amazon.com"] img, *[src*="rcm.amazon.com"], a[href*="s1.amazon.com"] img, *[src*="s1.amazon.com"], a[href*="advertising.com"] img, *[src*="advertising.com"], a[href*="ad.preferences.com"] img, *[src*="ad.preferences.com"], a[href*="link4ads.com"] img, *[src*="link4ads.com"], a[href*="rightmedia.net"] img, *[src*="rightmedia.net"], a[href*="sexcounter.com"] img, *[src*="sexcounter.com"], a[href*="paycounter.com"] img, *[src*="paycounter.com"], a[href*="webtrendslive.com"] img, *[src*="webtrendslive.com"], a[href*="oas.salon.com"] img, *[src*="oas.salon.com"], a[href*="realmedia.com"] img, *[src*="realmedia.com"], a[href*="gator.com"] img, *[src*="gator.com"], a[href*="bfast.com"] img, *[src*="bfast.com"], a[href*="counter.webtrends.net"] img, *[src*="counter.webtrends.net"], a[href*="googleadservices.com"] img, *[src*="googleadservices.com"], a[href*="googlesyndication.com"] img, *[src*="googlesyndication.com"], a[href*="adimg.cnet.com"] img, *[src*="adimg.cnet.com"], a[href*="us.a1.yimg.com"] img, *[src*="us.a1.yimg.com"], a[href*="us.i1.yimg.com"] img, *[src*="us.i1.yimg.com"], a[href*="eur.a1.yimg.com"] img, *[src*="eur.a1.yimg.com"], a[href*="a32.g.a.yimg.com"] img, *[src*="a32.g.a.yimg.com"], a[href*="backbeatmedia.com"] img, *[src*="backbeatmedia.com"], a[href*="adserver.ugo.com"] img, *[src*="adserver.ugo.com"], a[href*="ad.asap-asp.net"] img, *[src*="ad.asap-asp.net"], a[href*="claria.com"] img, *[src*="claria.com"], a[href*="cydoor.com"] img, *[src*="cydoor.com"], a[href*="kontera.com"] img, *[src*="kontera.com"], a[href*="ads.advance.net"] img, *[src*="ads.advance.net"], a[href*="ads.aol.com"] img, *[src*="ads.aol.com"], a[href*="ads.cdfreaks.com"] img, *[src*="ads.cdfreaks.com"], a[href*="ads.com.com"] img, *[src*="ads.com.com"], a[href*="ads.clearchannel.com"] img, *[src*="ads.clearchannel.com"], a[href*="ads.ezboard.com"] img, *[src*="ads.ezboard.com"], a[href*="ads.forbes."] img, *[src*="ads.forbes."], a[href*="ads.gamespy.com"] img, *[src*="ads.gamespy.com"], a[href*="ads.gamespyid.com"] img, *[src*="ads.gamespyid.com"], a[href*="ads.g4techtv.com"] img, *[src*="ads.g4techtv.com"], a[href*="ads.icq.com"] img, *[src*="ads.icq.com"], a[href*="ads.ign.com"] img, *[src*="ads.ign.com"], a[href*="ads.lycos.com"] img, *[src*="ads.lycos.com"], a[href*="ads.monster.com"] img, *[src*="ads.monster.com"], a[href*="ads.msn.com"] img, *[src*="ads.msn.com"], a[href*="ads.neowin.net"] img, *[src*="ads.neowin.net"], a[href*="ads.nypost.com"] img, *[src*="ads.nypost.com"], a[href*="ads.nytimes.com"] img, *[src*="ads.nytimes.com"], a[href*="ads.osdn.com"] img, *[src*="ads.osdn.com"], a[href*="ads.osnews.com"] img, *[src*="ads.osnews.com"], a[href*="ads.rottentomatoes.com"] img, *[src*="ads.rottentomatoes.com"], a[href*="ads.space.com"] img, *[src*="ads.space.com"], a[href*="ads.techtv.com"] img, *[src*="ads.techtv.com"], a[href*="ads.usatoday.com"] img, *[src*="ads.usatoday.com"], a[href*="ads.weather.com"] img, *[src*="ads.weather.com"], a[href*="ads.winsite.com"] img, *[src*="ads.winsite.com"], a[href*="ads.wunderground.com"] img, *[src*="ads.wunderground.com"], a[href*="ads.x10."] img, *[src*="ads.x10."], a[href*="ads.zdnet.com"] img, *[src*="ads.zdnet.com"], a[href*="clk.atdmt.com"] img, *[src*="clk.atdmt.com"], a[href*="bs0"][href*=".gmx.net"] img, *[src*="bs0"][src*=".gmx.net"] { display: none !important } /* images: by size */ a img[width="120"][height="240"], a img[width="120"][height="600"], a img[width="125"][height="300"], a img[width="125"][height="600"], a img[width="150"][height="100"], a img[width="150"][height="600"], a img[width="160"][height="600"], a img[width="180"][height="150"], a img[width="234"][height="60"], a img[width="210"][height="500"], a img[width="300"][height="125"], a img[width="300"][height="250"], a img[width="336"][height="280"], a img[width="380"][height="200"], a img[width="468"][height="60"], a img[width="470"][height="62"], a img[width="728"][height="90"], a img[width="730"][height="92"] { display: none !important } /* plugins: by size */ embed[width="120"][height="240"], object[width="120"][height="240"], embed[width="120"][height="600"], object[width="120"][height="600"], embed[width="125"][height="300"], object[width="125"][height="300"], embed[width="125"][height="600"], object[width="125"][height="600"], embed[width="150"][height="100"], object[width="150"][height="100"], embed[width="150"][height="600"], object[width="150"][height="600"], embed[width="160"][height="600"], object[width="160"][height="600"], embed[width="180"][height="150"], object[width="180"][height="150"], embed[width="210"][height="500"], object[width="210"][height="500"], embed[width="234"][height="60"], object[width="234"][height="60"], embed[width="300"][height="125"], object[width="300"][height="125"], embed[width="300"][height="250"], object[width="300"][height="250"], embed[width="336"][height="280"], object[width="336"][height="280"], embed[width="380"][height="200"], object[width="380"][height="200"], embed[width="468"][height="60"], object[width="468"][height="60"], embed[width="470"][height="62"], object[width="470"][height="62"], embed[width="728"][height="90"], object[width="728"][height="90"], embed[width="728"][height="100"], object[width="728"][height="100"], embed[width="728"][height="200"], object[width="728"][height="200"], embed[width="730"][height="92"], object[width="730"][height="92"] { display: none !important } /* iframes: by size */ iframe[width="120"][height="600"], iframe[width="125"][height="300"], iframe[width="125"][height="600"], iframe[width="150"][height="100"], iframe[width="150"][height="600"], iframe[width="160"][height="600"], iframe[width="180"][height="150"], iframe[width="210"][height="500"], iframe[width="234"][height="60"], iframe[width="300"][height="125"], iframe[width="300"][height="250"], iframe[width="336"][height="280"], iframe[width="380"][height="200"], iframe[width="468"][height="60"], iframe[width="470"][height="62"], iframe[width="600"][height="120"], iframe[width="728"][height="90"], iframe[width="728"][height="100"], iframe[width="728"][height="200"], iframe[width="730"][height="92"] { display: none !important } /* --- miscellaneous -------------------------------------------------------- */ a[href*="tryaol"] img, a[href*="/adlog.pl"] img, a[href*="/redirect"] img, a[href*="/referral/"] img, a[href*="/click.cgi"] img, a[href*="/clickover"] img, a[href*="/clickthr"] img, a img[src*="/affiliates/"], a img[src*="/creatives/"], a img[src*="/marketing/"], a img[src*="/offer"], a img[src*="/puffboxes/"], a img[src*="/sponsors/"], a img[src*="120x60"], a img[src*="120x80"], a img[src*="140x"], a img[src*="468x60"], a img[src*="_sponsor_"], a img[src*=".travelocity./Sponsor_gifs/"], a img[src*="pic.geocities.com/images/"], a img[src*="/us.yimg.com/a/ya"], a img[src*="/publicidad/"], a img[src*="public"][src*="ad"], a img[src*="klipmart"], a[name*="klipad"] img { display: none !important } a[alt*="advert"] img, object#widgeth, span.ad, table#RefAd, table[background*="advertising.com"], form[action*="doubleclick.net"] { display: none !important } iframe#adFrame, iframe#splashFrame, iframe#google_ads_frame, div#googleadb, /* google: general */ div.c.xs#ad, div#co div#rh.rhs[style], /* google: gmail */ span#konteraElements > *, /* Kontera */ span#iTt.iTt, /* IntelliTXT */ div#mntl, div#quack, div[id*="sponsor"], /* yahoo, general */ div[id*="advert"], div[id*="popup"], div#awin, div#yschsec, div.ovt, div[class*="advert"], div#adstrip, div#dcv_EchangeLay, div#adbox, div#splashLayer, div.showcase A.scLink, /* from floppymoose.com */ div#AD, div[id^="AD"][style^="position:absolute;"], /* lycos */ div#spons, /* altavista */ div#overture, /* nfl.com, general */ div#dropin, div#dwindow, div#topmsg, /* dynamicdrive.com */ div#cache, /* asp.flaaten.dk */ div#xad, /* proboards22.com */ div#floatpop, /* lyrics007.com */ div#warning[style*="visibility:"], /* adblock.org ;) */ div#elementDiv.welcomemat, /* linux.sys-con.com */ div#AdLayer, /* falkag.net */ div#catfish, div#adcontent, /* sitepoint.com */ div.VBannerAd, div.YourAdHere, /* flickr.com */ div#externals, div#text-ads, /* technorati.com */ div.ad, div.ads, /* 43things.com */ div#btmad, /* sourceforge.net */ div[id^="aws_"], /* 50megs.com */ div[id^="phpads"], /* dvd2svcd.doom9.net */ div[id^="liensponso"] { display: none !important } /* --- questionable (should probably identify and (re)move unless common) --- */ iframe[src^="/get_ad.php?"], /* geocities */ iframe[src^="/sponsored-results"], /* babelfish */ iframe[src^="/google/box?"], iframe[src*="contentsearch.de.espotting.com"], /* heise.de */ iframe[src*="industrybrains.com"], iframe[src*="BET365"], iframe[name="bsadframe"], iframe[src*="advert"] { display: none !important } table table table[width="346"][height="280"], 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;"], td[style="border-bottom: 1px solid rgb(204, 204, 204); padding: 7px 3px; background-color: rgb(255, 254, 249);"] { display: none !important } /* --- false positives ------------------------------------------------------ */ a[href*="/admin"] img, /* general admin pages */ a[href*=".adp"] img, /* aol */ a[href*="cart"] img, /* shopping sites */ a[href*="click.mp3"] img, /* mp3 download sites? */ a[href*=":head/"] img, a[href*="adobe"] img, /* new(er) from Neil */ a[href*="/advance"] img, a[href*=".add"] img, a img[src*="images.google.com/images?q="], /* yahoo (google images) */ a img[src*="/cnn/images/clickability/"] { /* cnn.com's "Story Tools" */ display: inline !important } /* bestbuy.com */ /*a img[src*="images.bestbuy.com"][src*="promos"] { display: inline !important }*/ /* alltheweb.com: images */ a[href*="click.alltheweb.com/go"] img[src*="fastsearch.net"] { display: inline !important } /* photo galleries? */ embed[type="application/x-shockwave-flash"][src*="gallery"] { display: inline !important } /* gamespot.com: screenshots (120x90) */ /*a[href*="screens.html?page="] img[src*="/gamespot/"] { display: inline !important }*/ /* www, images, news, groups, froogle.google.com */ body[onload^="document.gs.reset()"] div.n a[href^="/search?q="] img, body[onload^="document.gs.reset()"] div.n a[href^="/images?q="] img, body[onload^="document.gs.reset()"] a[href^="/imgres?imgurl="] img, body[onload^="document.gs.reset()"] div.n a[href*="/news?q="] img, body[onload="sf()"] a[href^="/groups?q="] img, a img[src^="/froogle_image?q="] { display: inline !important } /* foxnews.com videos */ div#video object embed[src*="/ads"][src*="foxnews.com"] { display: inline !important } /* imdb.com: posters/headshots linking fullpage interstitial ads. annoying, but the image should be displayed anyway. */ a[href*="imdb.com/ad/?id="] img[src*="imdb.com/media/"] { display: inline !important } /* yahoo.com: avatars, tv-related icons */ img[src*=".yimg.com/i/"][src*="/avtr/"], img[src*=".yimg.com/i/"][src*="/ytv/"] { display: inline !important } /* ticketmaster seating chart hit by div[id*="popup"] (thanks Bob) url-prefix(http://www.ticketmaster.com/seatingchart/) */ body[onload^="SS_preloadImages("][onload*="/media.ticketmaster.com/"]#body > div#popupframe { display: inline !important } /* allow everything for hapypmany.be */ @-moz-document domain(www.happymany.be) { a[href] img, *[src] { display: inline !important } } /* allow everything for hapypmany.com */ @-moz-document domain(www.happymany.com) { a[href] img, *[src] { display: inline !important } } /* allow everything for apple store */ @-moz-document domain(store.apple.com) { a[href] img, *[src] { display: inline !important } } /* -------------------------------------------------------------------------- */ /* Stylish <http://forums.mozillazine.org/viewtopic.php?t=327735> (Gecko 1.8+) END: } */ /* * For more examples see http://www.mozilla.org/unix/customizing.html */
  quote
DMBand0026
Veteran Member
 
Join Date: May 2004
Location: Chicago
 
2006-05-23, 09:33

Host file ad blocking is teh awesome. It's relatively simple to do too. I haven't seen many ads in about 6 months since I started using this, it's unobtrusive and page load times are considerably faster. I actually get frustrated when I'm on a friend's computer and they don't have the host files blocked and I can see ads.

For a down and dirty explanation (not to mention a better one than I could ever hope to give) go here. Than thank Brad (one of our administrators here at AppleNova) for the great write up and the help. I'm sure if your private messaged him and asked him really nicely he might even send you a copy of his host files that he has blocked. I know it's posted somewhere on AppleNova too if you feel like digging.

Never mind, it was an easy search so I'll just post it here for you. Check this out for a copy of Brad's host files.

Come waste your time with me
  quote
arnoz
New Member
 
Join Date: Oct 2005
Location: Brussels
 
2006-05-23, 09:58

Okay. First, sorry, i didn't think of searching. I've googled for a long time now so i didnt' even search on the forums before posting.
Anyway, thanks for your links. I will now try to understand this thing which seems to be pretty cool. Does it also block flash ads?
If i understood correctly, i've to manually ad every server of ads i would like to see blocked?

I will check the admin's host file, it seems to be very full of servers, thanks!

And concerning the _blank attribute for links, any hint? I know in Firefox we can type about:config to twek some things, dunno if Safari offers such a simple way.

Thanks!!
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-05-23, 09:59

Curses. DMBand0026 beat to be the punch regarding the hosts file!

The hosts file is a system-wide list of domain names mapped to IP addresses. If you "block" an ad server there by pointing to a bad IP address, that server will never be accessed from any apps on your system, be they a web browser like Safari or Firefox or any other type of application. It blocks all content on the server.

Yes, you have to update the file manually yourself. I find I only have to do that very rarely, though.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
arnoz
New Member
 
Join Date: Oct 2005
Location: Brussels
 
2006-05-23, 10:13

Thanks to both of you. I will try using your file. But i i want to add a server, how could i find his IP adress?

And, *ahem*, what about _blank links?
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-05-23, 10:22

If you read the instructions, you'll see that you don't need the IP address of the offending server. You just need the domain name (ie. www.google.com or forums.applenova.com) and you assign it a fake IP address like 0.0.0.0.
Quote:
Originally Posted by arnoz
And, *ahem*, what about _blank links?
Can't help you there. Nothing in CSS or HTML or JavScript can tell the browser to explicitly open something in a tab. That's a very browser-specific feature.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
arnoz
New Member
 
Join Date: Oct 2005
Location: Brussels
 
2006-05-23, 11:11

OK, i've added some servers (french ads) and now i don't see any ads. Thanks, it's too cool!
  quote
Majost
monkey with a tiny cymbal
 
Join Date: Nov 2004
Location: Lost
 
2006-05-23, 11:45

Quote:
Originally Posted by Brad
Can't help you there. Nothing in CSS or HTML or JavScript can tell the browser to explicitly open something in a tab. That's a very browser-specific feature.
Yup... and it's something that Shiira does marvelously. Give it a try... it uses the same rendering engine as Safari, and you can make it look and act very similarly. The idea behind the project is to give some flexibility to the engine.
  quote
arnoz
New Member
 
Join Date: Oct 2005
Location: Brussels
 
2006-05-23, 11:55

Mmmh, thanks, but i would prefer to keep Safari for the beginning. I will continue to look for a plugin or a hack.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-05-23, 12:13

Do note that Shiira, unlike Firefox, uses Safari's "engine" and shares (and expands upon) Safari's feature set. I like it very much and recommend it for users looking for a little more than what Safari offers.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
kylan
New Member
 
Join Date: Jan 2005
Location: California
 
2006-05-24, 03:53

Quote:
Originally Posted by arnoz
Mmmh, thanks, but i would prefer to keep Safari for the beginning. I will continue to look for a plugin or a hack.
Saft (the non-demo version) does what you are looking for as well having it's own adblocking/filtering. Check it out here: http://haoli.dnsalias.com
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools

« Previous Thread | Next Thread »

All times are GMT -5. The time now is 06:39.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova