[PrivacyBadger] Automatically settings all domains to red

Peter Eckersley pde at eff.org
Wed Jul 2 12:52:19 PDT 2014


On Wed, Jul 02, 2014 at 06:42:11PM +0200, Olga Musayev wrote:
> I'm modifying Privacy Badger for a different project, and one of the
> features I need is an option for the user to set all domains to red with
> one click. I'm going through the code, but I'm having a hard time following
> where exactly the full blocking action is taking place (popup.js 348:360
> has special case for cookieblock and noaction, but not for block).

Here are a few tips, though Cooper or Dan may be able to add more:

In privacy badger for chrome (but not firefox), the filters are
executed by the ABP filter engine, which is slightly modified from
upstream.  There are some notes on this here:

https://github.com/EFForg/privacybadgerchrome/blob/master/doc/IMPLEMENTATION.md

(In Firefox, Yan implemented a much simpler blocking engine from scratch
that doesn't support all of ABP's semantics)

You probably don't want to use userred as your state for blocking by
default, since semantically that's supposed to record a specific action
by the user that asked for a domain to always be blocked as a third
party.

Instead you might find it helpful to follow the thread from the place
where we decide to block domains heuristically (ie move from green to
either red or yellow), which happens here:

https://github.com/EFForg/privacybadgerchrome/blob/master/src/heuristicblocking.js#l614

You might be able to achieve what you want in Privacy Badger for Chrome
by writing ABP filter rules that are more complex than the ones we use,
for instance by scoping them to particular third parties.  You can read
more about that here:

https://adblockplus.org/en/filters

currently, every filter privacy badger uses ends with ^$thirdparty, but
you could use this mechanism instead or additionally:

https://adblockplus.org/en/filters#elemhide_domains

-- 
Peter Eckersley                            pde at eff.org
Technology Projects Director      Tel  +1 415 436 9333 x131
Electronic Frontier Foundation    Fax  +1 415 436 9993


More information about the PrivacyBadger mailing list