-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
Add option to disable sending the Do Not Track (DNT) signal #2089
Conversation
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.
Hello and thank you for the PR!
In addition to the feedback below, we should also add a check to avoid setting navigator.doNotTrack
when DNT signal sending is disabled.
src/_locales/en_US/messages.json
Outdated
@@ -23,6 +23,10 @@ | |||
"message": "Currently Privacy Badger only checks if third parties are using cookies, HTML5 local storage, or canvas fingerprinting to track your browsing. Some of these domains may be using tracking methods that Privacy Badger can't detect.", | |||
"description": "" | |||
}, | |||
"options_enable_dnt_checkbox": { | |||
"message": "Enable sending DNT header", | |||
"description": "" |
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.
Could you add a description to provide translators with context? You could describe where in Badger's UI this label is located.
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.
Done
src/_locales/en_US/messages.json
Outdated
@@ -23,6 +23,10 @@ | |||
"message": "Currently Privacy Badger only checks if third parties are using cookies, HTML5 local storage, or canvas fingerprinting to track your browsing. Some of these domains may be using tracking methods that Privacy Badger can't detect.", | |||
"description": "" | |||
}, | |||
"options_enable_dnt_checkbox": { | |||
"message": "Enable sending DNT header", |
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.
Let's rename "DNT header" to "Do Not Track signal", and link it to https://www.eff.org/issues/do-not-track.
"Do Not Track" instead of "DNT" because we shouldn't assume familiarity with the abbreviation.
"Signal" instead of "header" because we also assert DNT in JavaScript (#1861).
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.
Done
src/js/background.js
Outdated
@@ -459,6 +459,7 @@ Badger.prototype = { | |||
showCounter: true, | |||
showTrackingDomains: false, | |||
socialWidgetReplacementEnabled: true, | |||
DNTEnabled: true |
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.
Should use a more descriptive name like sendDNTSignal
.
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.
Please insert the new setting in alphabetic order.
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.
Done
src/js/background.js
Outdated
/** | ||
* Check if social widget replacement functionality is enabled | ||
*/ | ||
isDNTEnabled: function() { |
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.
DNTSignalEnabled
?
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.
Done
src/js/options.js
Outdated
} | ||
}); | ||
|
||
$("#check_dnt_policy_checkbox").prop("checked", enabled).prop("disabled", enabled); |
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.
When the options page first loads, "Check if sites comply with EFF's Do Not Track policy" is not grayed out, but toggling the send DNT signal checkbox grays it out. This is inconsistent.
If we are going to force-enable DNT checking when DNT sending is enabled, we should make it visually clear that DNT checking is a sub-option of DNT sending.
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.
Thanks, I've fixed this inconsistency. The grey-out state of the DNT checking is persisted now on initial load. And disabling sending the DNT header automatically disables the DNT checking.
Renamed the setting to sendDNTSignal to follow convention. Fixed the consistency with grey out state of "Check if sites comply with EFF's Do Not Track policy" when setting is disabled. Added some description for i18n.
Thanks for the feedback @ghostwords. I believe I've made all the suggested changes now and also avoided setting the navigator.doNotTrack in the contentscripts/dnt.js when this new DNT sending option is disabled. |
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.
Thanks! Got some more feedback.
src/_locales/en_US/messages.json
Outdated
@@ -23,6 +23,10 @@ | |||
"message": "Currently Privacy Badger only checks if third parties are using cookies, HTML5 local storage, or canvas fingerprinting to track your browsing. Some of these domains may be using tracking methods that Privacy Badger can't detect.", | |||
"description": "" | |||
}, | |||
"options_enable_dnt_checkbox": { | |||
"message": "Enable sending the <a href='https://www.eff.org/issues/do-not-track' target='_blank'>Do Not Track</a> signal", |
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.
Sorry, now that I look at this again, should this be more to the point and say, "Send the Do Not Track signal"?
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.
Done
src/js/webrequest.js
Outdated
@@ -776,6 +782,14 @@ function dispatcher(request, sender, sendResponse) { | |||
badger.storage.getBadgerStorageObject("action_map").deleteItem(request.origin); | |||
|
|||
sendResponse(); | |||
} else if (request.type == "checkDNT") { |
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.
This either has to be } else if (request.checkDNT) {
, or you have to update the message you send from the content script.
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.
Style nit: Could you add a blank line above the "else if"?
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.
Good catch. Fixed.
src/skin/options.html
Outdated
<input type="checkbox" id="enable_dnt_checkbox"> | ||
<span class="i18n_options_enable_dnt_checkbox"></span> | ||
</label> | ||
</div> | ||
<div class="checkbox"> |
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.
Could you indicate that checking DNT policies is a sub-setting of sending the DNT signal? Perhaps by indenting the DNT policies checkbox a bit.
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.
Yes, indented this option in, flush with the footer text.
Thanks! I'll re-review tomorrow. |
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.
Thank you for your contribution! Merging.
Add option to disable sending the Do Not Track (DNT) signal.
Followup commits: 2577cc2~3...2577cc2 |
This creates an option to disable sending the DNT header per issue #2038
The default setting is set to enabled.