EFForg / privacybadger

Privacy Badger is a browser extension that automatically learns to block invisible trackers.
https://privacybadger.org
Other
3.13k stars 379 forks source link

Still storing some non-tracking domains #1864

Open ghostwords opened 6 years ago

ghostwords commented 6 years ago

It looks like we are still recording non-tracking subdomains of tracking domains. This should be fewer non-tracking domains than before, but still, we shouldn't store any.

You can see if you have any such domains by running the following code in your Badger's background page:

(function () {
  const actionMap = badger.storage.getBadgerStorageObject("action_map"),
    actions = actionMap.getItemClones();

  for (const domain in actions) {
    const map = actions[domain];
      if (map.userAction == "" && map.heuristicAction == "") {
        console.log(domain);
      }
    }
}());

This follows up on https://github.com/EFForg/privacybadger/pull/1795#issuecomment-365009452 and #1446.

ghostwords commented 4 years ago

One complication is that we don't want to keep rechecking DNT on blocked domains.

We store last check time in the same action_map data structure. Discarding (never storing) non-tracking subdomains will discard these timestamps and precipitate DNT checks next time these subdomains are encountered and blocked (because of an already-blocked parent domain).

A potential fix would be to move last DNT check timestamps out of action_map into their own data structure subject to periodic cleanup.

ghostwords commented 4 years ago

This is related to #888 (for example #2676).

ghostwords commented 4 years ago

Firefox doesn't seem to enforce any storage.local-specific quotas at this time: https://github.com/EFForg/privacybadger/pull/2464#pullrequestreview-293282804