 |
 |
Blocking content in Safari with CSS
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2001
Status:
Offline
|
|
i am very new to this and was wondering how many of you use CSS to block content? i have had success with the following CSS, but for some reason it blocks out some images i want to be displayed. two of them are here:

what changes could i make to the code so that it is displayed?
Code:
/*
* This file can be used to apply a style to all web pages you view
* Rules without !important are overruled by author rules if the
* author sets any. Rules with !important overrule author rules.
*/
/*
* turns off "blink" element blinking
*/
blink { text-decoration: none ! important; }
/*
* hides many ads by preventing display of images that are inside
* links when the link HREF contans certain substrings.
*/
A:link[HREF*="ad."] IMG { display: none ! important }
A:link[HREF*="ads."] IMG { display: none ! important }
A:link[HREF*="/ad"] IMG { display: none ! important }
A:link[HREF*="/A="] IMG { display: none ! important }
A:link[HREF*="/0AD"] IMG { display: none ! important }
A:link[HREF*="/click"] IMG { display: none ! important }
A:link[HREF*="?click"] IMG { display: none ! important }
A:link[HREF*="?banner"] IMG { display: none ! important }
A:link[HREF*="=click"] IMG { display: none ! important }
A:link[HREF*="/ar.atwo"] IMG { display: none ! important }
A:link[HREF*="spinbox."] IMG { display: none ! important }
A:link[HREF*="transfer.go"] IMG { display: none ! important }
A:link[HREF*="advertise"] IMG { display: none ! important }
A:link[HREF*="adfarm"] IMG { display: none ! important }
A:link[HREF*="bluestreak"] IMG { display: none ! important }
A:link[HREF*="doubleclick"] IMG { display: none ! important }
A:link[HREF*="bannerspace"] IMG { display: none ! important }
A:link[HREF*="fastclick"] IMG { display: none ! important }
A:link[HREF*="affiliates"] IMG { display: none ! important }
A:link IMG[SRC*="affiliates"] { display: none ! important }
A:link IMG[SRC*="banner"] { display: none ! important }
/* disable ad iframes */
IFRAME[SRC*="ad."] { display: none ! important }
IFRAME[SRC*="ads."] { display: none ! important }
IFRAME[SRC*="/ad"] { display: none ! important }
IFRAME[SRC*="/A="] { display: none ! important }
IFRAME[SRC*="/0AD"] { display: none ! important }
IFRAME[SRC*="/click"] { display: none ! important }
IFRAME[SRC*="?click"] { display: none ! important }
IFRAME[SRC*="?banner"] { display: none ! important }
IFRAME[SRC*="=click"] { display: none ! important }
IFRAME[SRC*="/ar.atwo"] { display: none ! important }
IFRAME[SRC*="spinbox."] { display: none ! important }
IFRAME[SRC*="transfer.go"] { display: none ! important }
IFRAME[SRC*="advertise"] { display: none ! important }
IFRAME[SRC*="adfarm"] { display: none ! important }
IFRAME[SRC*="bluestreak"] { display: none ! important }
IFRAME[SRC*="doubleclick"] { display: none ! important }
IFRAME[SRC*="bannerspace"] { display: none ! important }
IFRAME[SRC*="fastclick"] { display: none ! important }
IFRAME[SRC*="affiliates"] { display: none ! important }
/* disable ad plugins */
EMBED[SRC*="ad."] { display: none ! important }
EMBED[SRC*="ads."] { display: none ! important }
EMBED[SRC*="/ad"] { display: none ! important }
EMBED[SRC*="/A="] { display: none ! important }
EMBED[SRC*="/0AD"] { display: none ! important }
EMBED[SRC*="/click"] { display: none ! important }
EMBED[SRC*="?click"] { display: none ! important }
EMBED[SRC*="?banner"] { display: none ! important }
EMBED[SRC*="=click"] { display: none ! important }
EMBED[SRC*="/ar.atwo"] { display: none ! important }
EMBED[SRC*="spinbox."] { display: none ! important }
EMBED[SRC*="transfer.go"] { display: none ! important }
EMBED[SRC*="advertise"] { display: none ! important }
EMBED[SRC*="adfarm"] { display: none ! important }
EMBED[SRC*="bluestreak"] { display: none ! important }
EMBED[SRC*="doubleclick"] { display: none ! important }
EMBED[SRC*="bannerspace"] { display: none ! important }
EMBED[SRC*="fastclick"] { display: none ! important }
EMBED[SRC*="affiliates"] { display: none ! important }
/* turning some false positives back off */
A:link[HREF*="download."] IMG { display: inline ! important }
A:link[HREF*="click.mp3"] IMG { display: inline ! important }
/*
* For more examples see http://www.mozilla.org/unix/customizing.html
*/
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
I use PithHelmet, but I also use this anti_banner.css file:
Code:
iframe[width="88"][height="31"], a img[width="88"][height="31"],
iframe[width="120"][height="600"], a img[width="120"][height="600"],
iframe[width="120"][height="240"], a img[width="120"][height="240"],
iframe[width="120"][height="120"], a img[width="120"][height="120"],
iframe[width="120"][height="90"], a img[width="120"][height="90"],
iframe[width="120"][height="60"], a img[width="120"][height="60"],
iframe[width="125"][height="600"], a img[width="125"][height="600"],
iframe[width="125"][height="125"], a img[width="125"][height="125"],
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="180"][height="150"], a img[width="180"][height="150"],
iframe[width="234"][height="60"], a img[width="234"][height="60"],
iframe[width="300"][height="250"], a img[width="300"][height="250"],
iframe[width="336"][height="280"], a img[width="336"][height="280"],
iframe[width="392"][height="72"], a img[width="392"][height="72"],
iframe[width="468"][height="60"], a img[width="468"][height="60"],
iframe[width="470"][height="62"], a img[width="470"][height="62"],
iframe[width="600"][height="90"], a img[width="600"][height="90"],
iframe[width="728"][height="90"], a img[width="728"][height="90"],
iframe[width="730"][height="92"], a img[width="730"][height="92"]
{display: none !important;}
a img[src*="banner.gif"], a img[src*="banner.jpg"],
a img[src*="hs_ad_rounded.gif"], a img[src*="_ad.gif"]
{display: none !important;}
*[src*="doubleclick.net"] *, *[href*="doubleclick.net"] *,
*[src*="hitbox.net"] *, *[href*="hitbox.net"] *,
*[src*="tradedoubler"] *, *[href*="tradedoubler"] *,
*[src*="/adx/"] *, *[href*="/adx/"] *,
*[src*="/ad"] *, *[href*="/ad"] *,
*[src*="/adx/"] *, *[href*="/adx/"] *,
*[src*="/ads/"] *, *[href*="/ads/"] *,
*[src*="/ads2/"] *, *[href*="/ads2/"] *,
*[src*="/adv/"] *, *[href*="/adv/"] *,
*[src*="/adserver."] *, *[href*="/adserver."] *,
*[src*="/adclick."] *, *[href*="/adclick."] *,
*[src*="/adfarm."] *, *[href*="/adfarm."] *,
*[src*="/adlog.pl"], *[href*="/adlog.pl"],
*[src*="/adview.php"], *[href*="/adview.php"],
*[src*="/adverts/"] *, *[href*="/adverts/"] *,
*[src*="/banner/"] *, *[href*="/banner/"] *,
*[src*="/banners/"] *, *[href*="/banners/"] *,
*[src*="view.atdmt.com"] *, *[href*="view.atdmt.com"] *,
*[src*="www.adendum.com"] *, *[href*="www.adendum.com"] *,
*[src*="ads.macsolutions.com"] *, *[href*="ads.macsolutions.com"] *,
*[src*="spinbox.versiontracker.com"] *, *[href*="spinbox.versiontracker.com"] *,
*[src*="spinbox.maccentral.com"] *, *[href*="spinbox.maccentral.com"] *,
*[src*="ads.macupdate.com"] *, *[href*="ads.macupdate.com"] *,
*[src*="spinbox.techtracker.com"] *, *[href*="spinbox.techtracker.com"] *,
*[src*="kermit.macnn.com"] *, *[href*="kermit.macnn.com"] *,
*[src*="a.tribalfusion.com"] *, *[href*="a.tribalfusion.com"] *,
*[src*="spd.atdmt.com"] *, *[href*="spd.atdmt.com"] *
{ display: none !important; }
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2001
Status:
Offline
|
|
Originally posted by ThisGuy:
what changes could i make to the code so that it is displayed?
/* turning some false positives back off */
A:link[HREF*="download."] IMG { display: inline ! important }
A:link[HREF*="click.mp3"] IMG { display: inline ! important }
/* added for forums.macnn.com */
A:link[HREF*="thread."] IMG { display: inline ! important }
That should do the trick
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2001
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Status:
Offline
|
|
oh man I hate flash ads. I've completely removed it from my plugins folder b/c I've no way of restricting it like we do with cookies and popups.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2003
Location: Minnesota
Status:
Offline
|
|
PithHelmet can block flash ads. Use it. It is your God.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2001
Status:
Offline
|
|
Originally posted by Turias:
PithHelmet can block flash ads. Use it. It is your God.
i have used it before, but safari used to crash pretty often on me. i was hoping for a css solution. thanks for the recommendation though.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jun 2002
Location: UK
Status:
Offline
|
|
Can someone help me blocking flash adds on this one specific site!!!
They use JAVA to display them, so I've never figured out what to do about it... [except to turn off javascript]
http://www.marca.com
I'm very interested to know how to do it!
Heeeeelp 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by VEGAN:
Can someone help me blocking flash adds on this one specific site!!!
They use JAVA to display them, so I've never figured out what to do about it... [except to turn off javascript]
http://www.marca.com
I'm very interested to know how to do it!
Heeeeelp
Which browser do you use to watch this site?... It's completely mangled in Safari. There really is no way to disable just the Flash ads in Safari because first there's really no way to detect them as ads and secondly, when they're generated with JavaScript, apparently you can't just hide the JavaScript block, since it generates new parts of the document that aren't affected by the css... Unless you can somehow see how it tags newly generated content and work from there, but that would be on a per site basis.
I messed around with that site to give it a shot and came up with...
div[style="float:left; margin-top:10px"] object { display: none ! important }
div[id="reloj"] object { display: none ! important }
div[id="flashequipos"] object { display: none ! important }
div[id="peugeot"] { display: none ! important }
div[id="publitop"] { display: none ! important }
div[id="menuizda"] { display: none ! important }
div[id="floatalminuto"] { display: none ! important }
div[id="servicios"] { display: none ! important }
But all that really does is not display any divs that I checked to have ads in them. Most of the divs just contain ads but I know that at least 'servicios' contains all the services in addition to the ad, and I can't figure out a way to just selectively not display the ad within the div. Either way hopefully this can show you what you need to do if you want to use it.
BTW, can anyone explain what's up with the [id*=] selection? It looks to be a "starts with" thing but I can't find it documented anywhere... thanks.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jun 2002
Location: UK
Status:
Offline
|
|
Originally posted by Synotic:
Which browser do you use to watch this site?... It's completely mangled in Safari. There really is no way to disable just the Flash ads in Safari because first there's really no way to detect them as ads and secondly, when they're generated with JavaScript, apparently you can't just hide the JavaScript block, since it generates new parts of the document that aren't affected by the css... Unless you can somehow see how it tags newly generated content and work from there, but that would be on a per site basis.
I messed around with that site to give it a shot and came up with...
div[style="float:left; margin-top:10px"] object { display: none ! important }
div[id="reloj"] object { display: none ! important }
div[id="flashequipos"] object { display: none ! important }
div[id="peugeot"] { display: none ! important }
div[id="publitop"] { display: none ! important }
div[id="menuizda"] { display: none ! important }
div[id="floatalminuto"] { display: none ! important }
div[id="servicios"] { display: none ! important }
But all that really does is not display any divs that I checked to have ads in them. Most of the divs just contain ads but I know that at least 'servicios' contains all the services in addition to the ad, and I can't figure out a way to just selectively not display the ad within the div. Either way hopefully this can show you what you need to do if you want to use it.
BTW, can anyone explain what's up with the [id*=] selection? It looks to be a "starts with" thing but I can't find it documented anywhere... thanks.
Thanks a lot it worked 
[Well, i lost the menus but that's a small problem]
Oh, I'm using Mozilla actually, and with Mozilla it looks all right 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2001
Status:
Offline
|
|
what do I have to block to get rid of the flash ads on yahoo? here is what I have narrowed it down to:
Code:
<center>
<table border=0 cellpadding=0 cellspacing=0><tr><td align=center><font face=arial size=-2>ADVERTISEMENT</font><br>
<script language=JavaScript>
var lrec_target="_blank";
var lrec_URL = new Array();
lrec_URL[1] = "http://rd.yahoo.com/SIG=1286vp135/M=292672.4818645.5979216.1354091/D=mail/S=150500014:LREC/EXP=1082134133/A=2095390/R=0/id=flashurl/SIG=11h6bubn2/*http://ad.doubleclick.net/clk;7814164;9022891;n";
var link="javascript:LRECopenWindow(1)";
var lrec_flashfile = 'http://us.a1.yimg.com/us.yimg.com/a/at/attwireless/041404rdblck_refurbflips_300x250.swf?clickTAG='+link+'';
var lrec_altURL = "http://rd.yahoo.com/SIG=1286vp135/M=292672.4818645.5979216.1354091/D=mail/S=150500014:LREC/EXP=1082134133/A=2095390/R=1/id=altimgurl/SIG=11h6bubn2/*http://ad.doubleclick.net/clk;7814164;9022891;n";
var lrec_altimg = "http://us.a1.yimg.com/us.yimg.com/a/at/attwireless/041404rdblck_refurbflips_300x250.gif";
var lrec_width = 300;
var lrec_height = 250;
</script>
<script language=JavaScript src=http://us.a1.yimg.com/us.yimg.com/a/1-/jscodes/031016/ct_lrec_031016.js>
</script>
<noscript>
<a href="http://rd.yahoo.com/SIG=1286vp135/M=292672.4818645.5979216.1354091/D=mail/S=150500014:LREC/EXP=1082134133/A=2095390/R=2/id=noscript/SIG=11h6bubn2/*http://ad.doubleclick.net/clk;7814164;9022891;n" target=_blank>
<img src="http://us.a1.yimg.com/us.yimg.com/a/at/attwireless/041404rdblck_refurbflips_300x250.gif" width=300 height=250 border=0></a>
</noscript>
</td></tr></table></center>
here is the css i am currently using:
Code:
iframe[width="88"][height="31"], a img[width="88"][height="31"],
iframe[width="120"][height="600"], a img[width="120"][height="600"],
iframe[width="120"][height="240"], a img[width="120"][height="240"],
iframe[width="120"][height="120"], a img[width="120"][height="120"],
iframe[width="120"][height="90"], a img[width="120"][height="90"],
iframe[width="120"][height="60"], a img[width="120"][height="60"],
iframe[width="125"][height="600"], a img[width="125"][height="600"],
iframe[width="125"][height="125"], a img[width="125"][height="125"],
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="180"][height="150"], a img[width="180"][height="150"],
iframe[width="234"][height="60"], a img[width="234"][height="60"],
iframe[width="300"][height="250"], a img[width="300"][height="250"],
iframe[width="336"][height="280"], a img[width="336"][height="280"],
iframe[width="392"][height="72"], a img[width="392"][height="72"],
iframe[width="468"][height="60"], a img[width="468"][height="60"],
iframe[width="470"][height="62"], a img[width="470"][height="62"],
iframe[width="600"][height="90"], a img[width="600"][height="90"],
iframe[width="728"][height="90"], a img[width="728"][height="90"],
iframe[width="730"][height="92"], a img[width="730"][height="92"]
{display: none !important;}
a img[src*="banner.gif"], a img[src*="banner.jpg"],
a img[src*="hs_ad_rounded.gif"]
{display: none !important;}
*[src*="doubleclick.net"] *, *[href*="doubleclick.net"] *,
*[src*="hitbox.net"] *, *[href*="hitbox.net"] *,
*[src*="tradedoubler"] *, *[href*="tradedoubler"] *,
*[src*="/adx/"] *, *[href*="/adx/"] *,
*[src*="/ad"] *, *[href*="/ad"] *,
*[src*="/adx/"] *, *[href*="/adx/"] *,
*[src*="/ads/"] *, *[href*="/ads/"] *,
*[src*="/ads2/"] *, *[href*="/ads2/"] *,
*[src*="/adv/"] *, *[href*="/adv/"] *,
*[src*="/adserver."] *, *[href*="/adserver."] *,
*[src*="/adclick."] *, *[href*="/adclick."] *,
*[src*="/adfarm."] *, *[href*="/adfarm."] *,
*[src*="/adlog.pl"], *[href*="/adlog.pl"],
*[src*="/adview.php"], *[href*="/adview.php"],
*[src*="/adverts/"] *, *[href*="/adverts/"] *,
*[src*="/banner/"] *, *[href*="/banner/"] *,
*[src*="/banners/"] *, *[href*="/banners/"] *,
*[src*="view.atdmt.com"] *, *[href*="view.atdmt.com"] *,
*[src*="www.adendum.com"] *, *[href*="www.adendum.com"] *,
*[src*="ads.macsolutions.com"] *, *[href*="ads.macsolutions.com"] *,
*[src*="spinbox.versiontracker.com"] *, *[href*="spinbox.versiontracker.com"] *,
*[src*="spinbox.maccentral.com"] *, *[href*="spinbox.maccentral.com"] *,
*[src*="ads.macupdate.com"] *, *[href*="ads.macupdate.com"] *,
*[src*="spinbox.techtracker.com"] *, *[href*="spinbox.techtracker.com"] *,
*[src*="a.tribalfusion.com"] *, *[href*="a.tribalfusion.com"] *,
*[src*="spd.atdmt.com"] *, *[href*="spd.atdmt.com"] *
*[src*="us.a1.yimg.com"] *, *[href*="us.a1.yimg.com"] *
*[src*="ad.doubleclick.net"] *, *[href*="ad.doubleclick.net"] *
{ display: none ! important; }
EMBED[SRC*="ad."] { display: none ! important }
EMBED[SRC*="ads."] { display: none ! important }
thanks
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Location: Los Angeles, CA.
Status:
Offline
|
|
are there any updates to the CSS ad-blocking files ?
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Sep 2004
Location: Earth
Status:
Offline
|
|
I use OmniWeb. It has sophisticated content blocking built in, and you can tailor it by defining your own rules.
One feature OW has that I've not seen in another browser is you can selectively disable plugins. For example, I run it with Flash disabled so I never see Flash ads, but still have other plug-ins, such as QuickTime, working. With most browsers, plug-ins are an "all-or-nothing" proposition. OmniWeb also lets you define a variety of preferences at the site-specific level. For example, if there's a site on which you want links underlined, but generally do not like underlined links, you can set link underlining on for just specific sites.
Overall, OmniWeb is far more sophisticated than Safari and allows you to tailor your Web experience in ways no other browser can support.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jun 2002
Location: UK
Status:
Offline
|
|
Originally posted by Dr. Smoke:
I use OmniWeb. It has sophisticated content blocking built in, and you can tailor it by defining your own rules.
One feature OW has that I've not seen in another browser is you can selectively disable plugins. For example, I run it with Flash disabled so I never see Flash ads, but still have other plug-ins, such as QuickTime, working. With most browsers, plug-ins are an "all-or-nothing" proposition. OmniWeb also lets you define a variety of preferences at the site-specific level. For example, if there's a site on which you want links underlined, but generally do not like underlined links, you can set link underlining on for just specific sites.
Overall, OmniWeb is far more sophisticated than Safari and allows you to tailor your Web experience in ways no other browser can support.
I prefer Firefox and AdBlock! Together, they are sweet! 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|