Skip to content
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

Merged
merged 6 commits into from
Jul 11, 2018

Conversation

miketung
Copy link

@miketung miketung commented Jul 9, 2018

This creates an option to disable sending the DNT header per issue #2038

The default setting is set to enabled.

Copy link
Member

@ghostwords ghostwords left a 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.

@@ -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": ""
Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -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",
Copy link
Member

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).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -459,6 +459,7 @@ Badger.prototype = {
showCounter: true,
showTrackingDomains: false,
socialWidgetReplacementEnabled: true,
DNTEnabled: true
Copy link
Member

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.

Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

/**
* Check if social widget replacement functionality is enabled
*/
isDNTEnabled: function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DNTSignalEnabled?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
});

$("#check_dnt_policy_checkbox").prop("checked", enabled).prop("disabled", enabled);
Copy link
Member

@ghostwords ghostwords Jul 9, 2018

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.

Copy link
Author

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.

Mike Tung added 2 commits July 9, 2018 10:51
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.
@miketung
Copy link
Author

miketung commented Jul 9, 2018

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.

Copy link
Member

@ghostwords ghostwords left a 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.

@@ -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",
Copy link
Member

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"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -776,6 +782,14 @@ function dispatcher(request, sender, sendResponse) {
badger.storage.getBadgerStorageObject("action_map").deleteItem(request.origin);

sendResponse();
} else if (request.type == "checkDNT") {
Copy link
Member

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.

Copy link
Member

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"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed.

<input type="checkbox" id="enable_dnt_checkbox">
<span class="i18n_options_enable_dnt_checkbox"></span>
</label>
</div>
<div class="checkbox">
Copy link
Member

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.

Copy link
Author

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.

@ghostwords
Copy link
Member

Thanks! I'll re-review tomorrow.

Copy link
Member

@ghostwords ghostwords left a 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.

@ghostwords ghostwords merged commit 02cb283 into EFForg:master Jul 11, 2018
ghostwords added a commit that referenced this pull request Jul 11, 2018
Add option to disable sending the Do Not Track (DNT) signal.
@ghostwords
Copy link
Member

ghostwords commented Jul 11, 2018

Followup commits: 2577cc2~3...2577cc2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants