Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Content Blocking by CSS in Safari

Posted by Hemos on Mon Apr 14, 2003 06:12 AM
from the not-seeing-it-anymore dept.
ahknight writes "There's a nice summary of how to get various kinds of content, in this case ads, blocked from being displayed via a custom stylesheet you add to your browser. This is mainly for Gecko-based browsers and rather old news, but the good news is that it also appears to work in the ... umm ... latest version of Safari."
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • nice ! (Score:1)

    by chrispy666 (519278) on Monday April 14 2003, @06:18AM (#5726740)
    safari already was blocking quite efficiently those nasty popups, but with this I don't even need to edit my host file to avoid having the ad banners ! cool
  • Ad blocking Good (Score:4, Insightful)

    by jasoncart (573937) on Monday April 14 2003, @06:32AM (#5726774)
    (http://www.ferrago.com/)
    I'd prefer to see the ads if it keeps the sites I enjoy reading in business.
    • Re:Ad blocking Good by jasoncart (Score:1) Monday April 14 2003, @06:35AM
    • There's a limit (Score:5, Insightful)

      by metamatic (202216) on Monday April 14 2003, @06:36AM (#5726785)
      (http://www.pobox.com/~meta/ | Last Journal: Sunday February 29 2004, @09:19AM)
      I didn't mind ads for a while, but when certain sites (ahem) started putting in those huge mega-ads that take up more than half my browser window, I had to start doing some ad blocking to make the web usable. It was either that or learn to
      read
      text
      that
      looks
      like
      this.

      Tragedy of the commons and all that. The people whose ads are being blocked should get angry at the idiots who force us to block ads by making their ads so huge, obnoxious and badly-placed.
      [ Parent ]
      • Stupid layout (Score:5, Insightful)

        The problem isn't so much the ads, rather it is the fact that the webmaster(baters) who create these sites set up their layouts assuming your screen is 800x600. Therefor, since the ads are 160 wide, and there are two of them (one on each side), that leaves 800-(2*160) = 400 (that's the sort of math these morons use) for the article.

        So, if you are running a 1600x1200 window and larger fonts (anti-aliasing? I need no anti-aliasing!)
        you
        get
        an
        article
        like
        this .

        If the morons would either
        • use a "width=*" for the article
        • Come to an agreement as to what class the actual article text would be

        then there wouldn't be a problem - large browser users like me would either get an article that spans the available space (the width option) or could at least override the setting on the article text in our CSS (the common class option).

        I've contacted several sites about this. For example, PBS (hosters of the Cringely articles) responded saying "Some people don't like long lines of text, so there!" (OK, then they can resize their windows to get the line length they want.)

        Unfortunately, since every site uses a slightly different "width=", and since CSS does not allow you to say "width=[400..800]" or something like that, you have to have a seperate entry for each site, and when the webmaster(bater) changes the layout you have to update your CSS and restart your browser.

        I do wish people would realise that HTML is about giving enough info to my browser to render the page, not about being pixel-exact.
        [ Parent ]
    • Re:Ad blocking Good by Anonymous Coward (Score:2) Monday April 14 2003, @06:42AM
  • Solves half the problem (Score:4, Interesting)

    by crow (16139) on Monday April 14 2003, @07:19AM (#5726930)
    (http://www.votecrow.com/ | Last Journal: Monday July 01 2002, @01:30PM)
    This solves half the problem. The other half is that the ads are still loaded, just not displayed. I'm using a variant of the style sheet hack, along with Proxy Auto Config [schooner.com] to redirect requests to ad sites to a server that returns transparent gifs for every request. It works much like JunkBuster, only it's integrated with the browser, so you don't have the side effects of using a proxy for every request (e.g., it's not any slower).

    Now I hardly ever see ads, and the ads I don't see never get loaded in the first place, saving my bandwidth. Of course, that means that the web sites I visit never record a hits on their ad servers from me, whereas using the style sheet alone is completely transparent to the server.

    Oh, and both the Proxy Auto Config and the Style Sheet hacks should work just fine with most web browsers, not just Mozilla and Safari.

  • *cough* (Score:3, Informative)

    by Fweeky (41046) <tom.hurst@clara.net> on Monday April 14 2003, @07:37AM (#5727014)
    (http://hur.st/)
    anti-banner.css [aagh.net], and I don't assume you're using Mozilla. I'd be interested to hear if it works in other browsers (other than Opera/Mozilla/IE, that is), and in receiving instructions on how to use it in them.
  • The latest version of Safari? (Score:3, Informative)

    by shippo (166521) on Monday April 14 2003, @07:41AM (#5727030)
    Do you mean the one that has just appeared in Software Update - 1.0 Beta 2 (v73)?
  • Junkbuster? (Score:3, Interesting)

    by bedouin (248624) on Monday April 14 2003, @08:10AM (#5727193)
    I've been using Junkbuster to block ads for the past two years, but it's becoming pretty much ineffective since the blocklist [waldherr.org] is never updated.

    Anyone know of a source for fresh blocklists, or a program that's updated more regularly? I'd prefer to keep it Junkbuster if possible.
  • by the way... (Score:2, Informative)

    by gabe (6734) on Monday April 14 2003, @08:21AM (#5727254)
    (http://sumorai.net/ | Last Journal: Monday February 17 2003, @10:29PM)
    Apple released Safari beta 73 this morning via software update. Enjoy.
  • Privoxy (Score:2)

    by mTor (18585) on Monday April 14 2003, @09:37AM (#5727827)
    This CSS stylesheet doesn't really work that great. It only solves parts of the problem and doesn't really adress al of them. If you want a fairly complete privacy solution, take a look at Privoxy which some people have called : "junkbusters on speed". Yes, there is an OS X version and it works great with Safari.

    http://www.privoxy.org/ [privoxy.org]

    • Re:Privoxy by PopeZaphod (Score:1) Monday April 14 2003, @10:39PM
  • by Feztaa (633745) on Monday April 14 2003, @11:36AM (#5728826)
    (http://exolucere.ca/)
    ... what we really need is a way to block images with specific dimensions; most ads come in two specific sizes, the "wide narrow banner" and the "big fat box", both of which can be seen on Slashdot.
  • Blocks Flash ads! (Score:3, Informative)

    by Jobe_br (27348) <bdruthNO@SPAMgmail.com> on Monday April 14 2003, @01:54PM (#5729907)

    For those not aware of this, it is possible to use this CSS method of blocking ads to block Flash advertisements .. arguably, the most annoying. Try something like so:

    embed[type="application/x-shockwave-flash"][width= "468"][height="60"]

    {
    display: none !important;
    visibility: hidden !important;
    }

    As you find Flash ads that aren't blocked, just add another entry for the size of ad you're seeing ... in my CSS, I have at least 8-10 such entries. Common sizes are:

    • 468x60
    • 728x90
    • 120x600
    • 336x280
    • 300x250
    • 180x150
    • 240x400
    • 468x240
    • 120x600
    • 160x600
    • 336x280
  • hosts is still the easy way to go (Score:2, Informative)

    by snuffdiddy23 (620624) on Monday April 14 2003, @05:36PM (#5731783)
    open Directory Access.app and enable BSD Configuration files, get a good hosts file and pico /etc/hosts usually does fine for most of my content blocking needs. if i knew how to use vi i could probably cut a good four and half seconds off that.
  • OmniWeb blocks ads with no effort (Score:1, Informative)

    by Anonymous Coward on Tuesday April 15 2003, @12:07PM (#5737102)
    For people with more money than energy, buy OmniWeb. I am way too lazy to do anything suggested here, OmniWeb does all my ad-blocking for me. And it is smarter about pop-ups than Safari, I see the pop-ups I need and not the ones I don't.