Re: advertisement blocking



On Thu, 2005-02-10 at 17:35 +0100, Martin Bajer wrote:
> Hello everyone,
> 
>  please help me to find the answer how to block unwanted content on
> webpages using Epiphany. I fatally miss something like the Firefox
> "Adblock extension". I have been seaching in mailing list, google etc.
> But I wasn't successful ;(
> 
>  I want to block for example these:
> *.swf
> */string.*
> http://adrenaline.cz/*
> http://vlak.cz/img/d_flag.gif
> http://www.toplist.cz/images/counter.asp?a=bc&ID=20856
> 
>  Is there any config file, utility or feature to define it in Epiphany
> or in the GNOME (GNU+Linux) at all? Any idea ?

There is an Epiphany extension (named "adblock") which does what you
want. (Basically, it copies the backend of adblock -- with a twist --
but at the moment offers no front-end.)

There is a problem, though! The adblock extension is blocking on a
couple of Mozilla bugs (#246092 which depends on #246085). Without those
bugs fixed, the adblock still *works*. But it will only work if you
restart Epiphany after enabling it, and Epiphany will crash on exit.
(That's not really that big a deal if you never close all your browser
windows. No harm is done by the crash.)

Anyway, if you're very gung-ho you can apply the patches in those bugs
and recompile Mozilla. Or you can just live with the crashes. Either
way, the adblock extension does what you want.

Oh, and it'll probably only work with Epiphany 1.5.

I've never documented it, so I'll do so now and then copy/paste this
into a web page at some point.

First of all, installation: you'll have to compile it from source.
Either use epiphany-extensions from CVS or download the latest
development version from Epiphany's website,
http://www.gnome.org/projects/epiphany. Run ./configure
--with-extensions=all,adblock [since adblock is disabled by default];
make; make install. If you use jhbuild, that gets easier (change your
moduleset to pass "--with-extensions=all,adblock" or something, and run
"jhbuild buildone epiphany-extensions").

If you got past that step, it's all smooth sailing!

In Epiphany, go Tools -> Extensions and enable adblock. Close Epiphany
completely (that's the last time it won't crash on exit) and then start
it again. That's it. (Note: when those Mozilla bugs are fixed, *all*
these problems will go away. You'll just have to go Tools -> Extensions
and enable adblock without a restart. And adblock will ship with your
distribution, so you won't need to compile it.)

The adblock keeps a *default* set of blocked URLs
in /usr/share/epiphany-extensions/adblock-patterns (depending on where
you installed it, of course). This list is not really meant to be
edited; it should Just Work.

If there are still ads you don't want, (create and) edit
~/.gnome2/epiphany/extensions/data/adblock/blacklist and put in
Perl-compatible regular expressions. "*.swf" becomes "\.swf$",
"*/string.*" becomes "\/string\.", etc.

If adblock thinks something's an ad when it's not, (create and) edit
~/.gnome2/epiphany/extensions/data/adblock/whitelist and put in
Perl-compatible regular expressions.

However, I feel quite confident you won't need to worry about the last
two paragraphs. The default filters are very good.

If compilation is too daunting for you, then... well, sorry. Check back
in a month or two if things have changed; I wouldn't be surprised if the
Ubuntu people make this work by the time Hoary is released.

-- 
Adam Hooper <adamh densi com>

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]