EFForg / privacybadgerfirefox-legacy

LEGACY Privacy Badger for Firefox SEE README
https://www.eff.org/privacybadger
Other
407 stars 68 forks source link

PB blocks localstorage resources after 4 loads, not 3 #726

Open Hainish opened 8 years ago

Hainish commented 8 years ago

Tested on https://pbtest.org/ using a fresh Firefox profile with PB newly installed, I get the following result for loading of localstorage objects:

screenshot - 02102016 - 05 46 10 pm

This causes the following test to fail initially: screenshot - 02102016 - 05 47 22 pm

After a page reload, the test passes.

cooperq commented 8 years ago

If I recall this might have been necessary due to the timing of how privacy badger detects local storage tracking. @gunesacar may be able to offer more insight. Is it possible to modify the tests to account for this?

Hainish commented 8 years ago

@cooperq it's possible. I'll wait for @gunesacar's reply before I start on this.

gunesacar commented 8 years ago

Good catch! Apparently we undercount the supercookie prevalence by one.

The reason for this is we don't call recordPrevalence for the first occurrence of supercookie trackers. We record the prevalence in heuristicBlockingAccounting and we don't yet know whether this is a supercookie tracker or not while making the first HTTP request.

I added a call to recordPrevalence when we first encounter a supercookie tracker. https://github.com/EFForg/privacybadgerchrome/compare/master...gunesacar:issue726?expand=1 The test passes with this change.

This issue applies to both Firefox and Chrome versions, if you like the Chrome fix I can send PR for Firefox too.