AdBlock Extension

New Design

Regular expressions

By default, Epiphany's AdBlock will come with a list of Perl regular expression filters -- FilterSet.G. This will be installed as /usr/share/epiphany-extensions/adblock-patterns. Any URL matching that pattern will be blocked.

But of course, there will be a few false positives. In my tests, that proportion will be very small, but it won't be 0. What's more, power users may be annoyed and want to add regular expressions of their own. The files ~/.gnome2/epiphany/extensions/data/adblock/(blacklist|whitelist) are used for these purposes.

User Interface

The #1 requirement (which already works): ads will simply be blocked with no setup required. The user will be notified by an icon on the statusbar, similar to the popup-blocker. FUTURE: the ad itself will be replaced by a proxy HTML element with a nice logo. Clicking on the logo will load the ad. Right-clicking, one would get the option to permanently allow the ad's host (automatically writing to the user's whitelist file).

The user will be able to go to View -> Advertisements -> [list of hosts], where [list of hosts] is a list of all blocked hosts, as toggles. Toggling ads on will load them immediately. Turning them back off will not change the current page (unless I decide the hacking effort is worthwhile...). spark: probably better to turn ads on individually by context-clicking them since users won't know which ads correspond to which hosts.

There will be no front-end to the blacklist or whitelist files (besides our per-host whitelist entries). However, we could listen for changes to the files and automatically reload the block lists; that would give power users the opportunity to test their regular expressions immediately.

Current Status

The blocking works, but very little UI has been written so far. There's a proof-of-concept statusbar icon which shows up when ads are blocked (and stays when you switch tabs...).

The current extension crashes on shutdown. I believe that's because of Mozilla's Bug #246092, for which Christian has written a patch.

see also #364285 (Enable adblock by default)

Concerns

I don't know how fast this will all be. But it will certainly be much faster than Firefox's, since it only compiles the regular expressions once and since it's written in C and not Javascript. In my tests, I haven't noticed any slowdowns; having a lot of entries on a whitelist may change that, though. Ideally, there would be little need for those; if the need is too great, we'll have to diverge from FilterSet.G (which is a shame, because that list is frequently updated).

Suggestions

Blocking based on image (and HTML element?) size would help, similar to the BannerBlind extension.

Making animated GIFs, Flash, and Java click to play would be a simple method that would go a long way in improving people's web experiences, as Flashblock does only for flash.

Old (obsolete) Brainstorming

Existing implementation

The epiphany-extensions CVS module has an adblock extension. Install it, and edit ~/.gnome2/epiphany/extensions/data/adblock-patterns to add some POSIX regular expression patterns. For example:

.*/ad/.*

.*/ads/.*

.*/banner/.*

.*adtech.*

.*annonce.*

.*banners.*

.*doubleclick.*

# From Slashdot

http://ads.osdn.com/.*

Planning

There is an obvious need for an ad-blocking extension, like Mozilla's AdBlock extension. However, that extension is not worth porting to Epiphany as-is. What do we need/want related to the Mozilla extension?

http://adblock.mozdev.org/settings.rf1.png

What does the Mozilla extension do wrong?

TONS. Impossible to list it all. Basically, it is not easy to use, despite the assertion that it is on the front page and the reviews from tons of "power users". The prefs window has tons of meaningless options ("Obj-tabs") and the thing takes more than five minutes to set up for a new user.

The biggest problem, though, is that it takes effort! I've used Bayesian filtering on Evolution, and it was painless (with zero false positives, ever). Adblock is, in comparison, a nightmare. When you first install it, for example, it does nothing. Enabling/disabling the filter only applies to the next page load. Disabling filters is nontrivial.

On the other hand, people love Adblock. They have no idea how much better things could be.

So let's go back to basics: what do we want?

What can we use?

What do we have that works well?

Comments

Epiphany/AdBlockExtension (last edited 2008-02-03 14:45:20 by localhost)