-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop recording non-tracking domains #1795
Conversation
3491575
to
762959a
Compare
762959a
to
12fd302
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. To clarify, the addition of the skip_dnt_check
is what is preventing non-tracking domains from remaining in action_map
should someone import from an older version where non-tracking domains are present, correct?
@@ -121,10 +121,6 @@ HeuristicBlocker.prototype = { | |||
return {}; | |||
} | |||
|
|||
window.setTimeout(function () { | |||
badger.checkForDNTPolicy(fqdn); | |||
}, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the refactoring of the checkForDNTPolicy block, the function signature here should be updated accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish GitHub allowed me to add a comment to a line of code that wasn't directly modified by a pull request :P
The comment describing this function mentions that it sets a timeout to check for DNT policies; given this change, that aspect of the comment is no longer directly relevant for this function so it should be removed. Hopefully that makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, got it now, thanks!
src/js/heuristicblocking.js
Outdated
*/ | ||
_recordPrevalence: function (tracker_fqdn, tracker_origin, page_origin) { | ||
_recordPrevalence: function (tracker_fqdn, tracker_origin, page_origin, skip_dnt_check) { | ||
var snitch_map = this.storage.getBadgerStorageObject('snitch_map'); | ||
var firstParties = []; | ||
if (snitch_map.hasItem(tracker_origin)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change snitch_map
to snitchMap
to match naming convention used in newly added migration, etc.
src/js/storage.js
Outdated
@@ -323,10 +323,18 @@ BadgerPen.prototype = { | |||
|
|||
/** | |||
* Remove user set action from a domain | |||
* @param domain FQDN string | |||
**/ | |||
* @param domain FQDN string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to @param {String} domain
format.
|
Non-tracking domains are explicitly removed from user data imports by re-running the migration: 611ad70#diff-46ee54a6a841ec40759bc995200e52d2R183. |
Instead of checking most* third-party domains. This avoids creating action_map entries for non-tracking domains. [*] This also checks DNT for tracking domains found through localStorage or canvas fingerprinting. Previous logic checked cookie-based third-party domains only.
Saves extra work, as DNT compliance does not override user preference.
12fd302
to
1c0a3d2
Compare
Rebased with master, implemented suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor clarification comment on return type, otherwise looks good!
@@ -395,7 +403,7 @@ BadgerStorage.prototype = { | |||
* Get an item | |||
* | |||
* @param {String} key - the key for the item | |||
* @return the value for that key or null | |||
* @return {?*} the value for that key or null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Clarification] Just as an aside, this return type is unfamiliar to me; can you clarify what this means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm mixing the ?
prefix, which signifies something could be null (see the JSDoc doc. page for @type), and this SO answer for how to specify a type that could be anything. This is probably not actually supported ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, fair enough! I guess right now we only return {?string}
, but absolutely true there's no reason why this couldn't change at some point. Thanks for the explanation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BadgerStorage.prototype.getItem
can return any type:
//"object"
typeof badger.storage.getBadgerStorageObject('action_map').getItem('outbrain.com')
//"boolean"
typeof badger.getSettings().getItem("seenComic")
I might have written or said at some point that this PR should have no effect on the list of tracking domains on the options page. I was thinking since the list is of tracking domains, and we stop recording (& remove existing) non-tracking domains, there will be no change to the list. In reality, no, the list is (almost certainly) going to get smaller. We currently display non-tracking subdomains of tracking domains in the list (because subdomains inherit tracking status from parent domains). After this PR, we will no longer display those subdomains (since we will no longer record them). There shouldn't be any change to what Privacy Badger blocks or doesn't block on pages you visit. |
Stop recording non-tracking domains.
@terrorist96 Once your Privacy Badger updates to 2018.1.25, could you run a couple of debugging queries to see where your Badger is at post upgrade? Let's see how much space your Badger uses and what your most populous domains are at this point. |
|
This looks good to me. Your storage use decreased at least fivefold, plus the 27K+ |
But didn't you say the limit is 2MB without the |
Extension storage ( My intuition is that Privacy Badger learning is front-loaded with a long tail. I expect it would take a long time for your Badger to get to 2 MB, but I could be wrong! I wonder what's a good (simple) early-warning system we could put in place to help prevent Badger users from running out of space in the future. |
5 is better than 2 and gives me more peace of mind. Though I wish there was some option in between 5 and unlimited. |
Picking up from #1795 (comment), 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. |
Fixes #1446. Fixes #1405 by virtue of no longer checking DNT for non-tracking domains.
action_map
.action_map
entry is set to all defaults (meaning no tracking recorded), and if it is, remove it.unlimitedStorage
permission now, or we have to do another release first (to get non-tracking domains removed before we removeunlimitedStorage
).Follows up on #1642 in terms of continuing to evolve our DNT checking approach.