Closed Bug 1107133 Opened 9 years ago Closed 9 years ago

expose privacy.trackingprotection.enabled in fennec privacy preferences

Categories

(Firefox for Android Graveyard :: Settings and Preferences, defect)

x86
Android
defect
Not set
normal

Tracking

(fennec37+)

RESOLVED FIXED
Firefox 37
Tracking Status
fennec 37+ ---

People

(Reporter: mmc, Assigned: Margaret)

References

Details

Attachments

(2 files, 1 obsolete file)

It is now possible to enable tracking protection and get the shield/doorhanger in fennec, but the pref itself is only in about:config.
Blocks: 1029886
Component: DOM: Security → Settings and Preferences
OS: Mac OS X → Android
Product: Core → Firefox for Android
Assignee: nobody → margaret.leibovic
tracking-fennec: --- → ?
Joni or Roland, is there a SUMO article for tracking protection on mobile? I'm looking for a mobile equivalent of this page: https://support.mozilla.org/en-US/kb/tracking-protection-firefox

I'm just going to use that URL in my patch in the meantime, but it would be good to update the URL before I land the patch.
Flags: needinfo?(rtanglao)
Flags: needinfo?(jsavage)
Attachment #8533397 - Flags: review?(liuche)
/r/1335 - Bug 1107133 - Expose tracking protection in Fennec privacy preferences

Pull down this commit:

hg pull review -r 66816847595c659facbd0ab039d83e1470261d6b
Attached image screenshot
I mostly stole the UX here from desktop. Robin, can you give this a once-over and let me know if you think this is okay?
Attachment #8533398 - Flags: feedback?(randersen)
Hi Margaret, we don't have an article yet, but we'll start working on it. I've created a URL for the new article: https://support.mozilla.org/kb/firefox-android-tracking-protection. Feel free to use this new link in your patch. Content will be added soon.
Flags: needinfo?(jsavage)
/r/1335 - Bug 1107133 - Expose tracking protection in Fennec privacy preferences

Pull down this commit:

hg pull review -r 48547d8d37143994c144ddb79fc4e0d28b4fcf75
(I updated my patch to only expose this UI to Nightly builds)
(In reply to Joni Savage from comment #5)
> Hi Margaret, we don't have an article yet, but we'll start working on it.
> I've created a URL for the new article:
> https://support.mozilla.org/kb/firefox-android-tracking-protection. Feel
> free to use this new link in your patch. Content will be added soon.

Thanks so much! I'll put that URL in the patch.
/r/1335 - Bug 1107133 - Expose tracking protection in Fennec privacy preferences

Pull down this commit:

hg pull review -r f0ec7de51fce985266471e6f8ec701691b0c6f33
Roland, I think Tracking protection is different from DNT - the preference for DNT is still there, but this is different, and actually "enforces" do not track.

From https://support.mozilla.org/kb/tracking-protection-firefox :

"Essentially, it asks the question: what would the web feel like if a Do Not Track signal were more widely respected."
https://reviewboard.mozilla.org/r/1335/#review777

r+ with comments

Also, I think when you pushed, you ended up pushing two copies of this to reviewboard - I have this review request, as well as an identical one at https://reviewboard.mozilla.org/r/1333/

::: mobile/android/base/resources/xml/preferences_privacy.xml
(Diff revision 3)
> +                        android:defaultValue="false"

I'm pretty sure we don't use defaultValue correctly throughout preferences, so let's change that in this file, at least.

For Gecko prefs, we shouldn't set defaultValue, especially if we set persistent=false - we should fetch it from Gecko the first time, and we shouldn't rely on defaultValue. (If persistent=false, this additionally means the Preferences screen sets the value to be defaultValue every time).

"persistent" is also somewhat inconsistent - it sets whether the pref should be persisted to (Android) SharedPreferences. We should only set this true for Android-only preferences (because for Gecko prefs, we want to fetch them from Gecko every time, in case they've been changed by Gecko and the value persisted in SharedPreferences becomes inconsistent).

::: mobile/android/base/resources/xml/preferences_privacy.xml
(Diff revision 3)
>                          android:defaultValue="false"

Might as well remove this defaultValue too.

I did some poking around that you can try out too, if you're curious:
If you change this pref to the non-default (true), and then open this Preferences screen when it's not loaded in memory (so the entire screen greyed out), the checkbox value will be wrong - it loads defaultValue (false), not what you've set it to (true).

::: mobile/android/base/tests/testSettingsMenuItems.java
(Diff revision 3)
> -        { StringHelper.TRACKING_LABEL },
> +        { StringHelper.TRACKING_PROTECTION_LABEL },

\o/ for updating tests! :)
https://reviewboard.mozilla.org/r/1333/#review779

I'm not sure how to close this review request because it's a dupe of the other one - says I don't have perms? Maybe you can close this, Margaret?
(ooo reviewboard automation is pretty cool)
Comment on attachment 8533397 [details]
MozReview Request: bz://1107133/margaret

r+ with comments.

...I'm a little disappointed reviewboard doesn't flip this flag for me!
Attachment #8533397 - Flags: review?(liuche) → review+
(In reply to Chenxia Liu [:liuche] from comment #15)
> Comment on attachment 8533397 [details]
> MozReview Request: bz://1107133/margaret
> 
> r+ with comments.
> 
> ...I'm a little disappointed reviewboard doesn't flip this flag for me!

I asked mconley about this on IRC, and apparently you need to flip the flag on the "root" review request, which is the one with the subject "bz://[bugnumber]/[ircnick]".

In this case, I think the review 1333 is the root, and 1335 is the single commit (the id was incremented because I updated the patch twice).

AIUI, we kinda hacked reviewboard for allowing multiple commits in a single review request, each of which can be individually reviewed. Since I only have one commit in this review request, this is just a bit confusing. I think there are bugs on file to improve the UX around this.
(In reply to Chenxia Liu [:liuche] from comment #12)

> ::: mobile/android/base/resources/xml/preferences_privacy.xml
> (Diff revision 3)
> > +                        android:defaultValue="false"
> 
> I'm pretty sure we don't use defaultValue correctly throughout preferences,
> so let's change that in this file, at least.
> 
> For Gecko prefs, we shouldn't set defaultValue, especially if we set
> persistent=false - we should fetch it from Gecko the first time, and we
> shouldn't rely on defaultValue. (If persistent=false, this additionally
> means the Preferences screen sets the value to be defaultValue every time).

Good catch! I feel like this stuff just gets cargo-culted from file to file. Can you file a new mentor bug to clean this up?

> "persistent" is also somewhat inconsistent - it sets whether the pref should
> be persisted to (Android) SharedPreferences. We should only set this true
> for Android-only preferences (because for Gecko prefs, we want to fetch them
> from Gecko every time, in case they've been changed by Gecko and the value
> persisted in SharedPreferences becomes inconsistent).

Yeah, I remember working to update that bit at one point. Would also be worth fixing in a mentor bug!
Attachment #8533397 - Flags: review+ → review?(liuche)
/r/1335 - Bug 1107133 - Expose tracking protection in Fennec privacy preferences. r=liuche

Pull down this commit:

hg pull review -r 8b6fb71d452bb87f34297eaa1ef200d4094b6787
Attachment #8533397 - Flags: review?(liuche) → review+
https://hg.mozilla.org/mozilla-central/rev/eb32947900a9
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
tracking-fennec: ? → 37+
I uplifted the NIGHTLY_BUILD part of this patch to 36 in order to uplift Bug 1113296.

https://hg.mozilla.org/releases/mozilla-aurora/rev/cd79379ebfa4
Attachment #8533398 - Flags: feedback?(randersen)
I stumbled upon https://support.mozilla.org/en-US/kb/firefox-android-tracking-protection which indicates that 

> Tracking Protection will turn on the Do Not Track feature and prevent websites from loading content that tracks you.

But we don't seem to do that. Who's right or wrong here?
Flags: needinfo?(mmc)
(In reply to Aaron Train [:aaronmt] from comment #23)
> I stumbled upon
> https://support.mozilla.org/en-US/kb/firefox-android-tracking-protection
> which indicates that 
> 
> > Tracking Protection will turn on the Do Not Track feature and prevent websites from loading content that tracks you.
> 
> But we don't seem to do that. Who's right or wrong here?

I am going to modify that support article to state that "Turning on Polaris will enable Tracking Protection and DNT". The state of the prefs is very confusing thanks to privacy.trackingprotection.ui.enabled and browser.polaris.enabled.

The flow which was approved for Nov 10 on desktop was:

1) Turn on browser.polaris.enabled
2) This enables privacy.trackingprotection.ui.enabled (which shows the tracking protection checkbox in prefs), privacy.trackingprotection.enabled (which checks the checkbox) and enables DNT.

Each one can be disabled individually.
Flags: needinfo?(mmc)
With a clean profile, go to about:config and search for "privacy.trackingprotection.enabled". The pref is "false". Go to Settings->Privacy, "Tracking protection" option is not checked. Enable it and go  back to about:config and search for "privacy.trackingprotection.enabled". Now "Tracking protection" is "true".

Once the option is activated, go for example to neowin.net and see that a shield is displayed in the URL Bar. Tapping it and choosing "Disable protection", "Tracking Protection" for the site is disabled. A shield with a red strike-through is displayed. Tapping it and choosing "Enable protection", "Tracking Protection" for the site is re-enabled.
So verified as fixed using:
Build: Firefox for Android 38.0a1 (2015-01-15)
Device: Alcatel One Touch (Android 4.1.2)
QA Contact: teodora.vermesan
Comment on attachment 8533397 [details]
MozReview Request: bz://1107133/margaret

https://reviewboard.mozilla.org/r/1333/#review3611

Ship It!
Attachment #8533397 - Flags: review+
Did this get changed recently? I seem to remember it showing up in Settings > Privacy on Nightly but it no longer does.
Flags: needinfo?(margaret.leibovic)
(In reply to [:mmc] Monica Chew (please use needinfo) from comment #28)
> Did this get changed recently? I seem to remember it showing up in Settings
> > Privacy on Nightly but it no longer does.

I see it there in Nightly. What version are you using?
Flags: needinfo?(margaret.leibovic) → needinfo?(mmc)
The version that encourages operator errors :) Sorry for the noise!
Flags: needinfo?(mmc)
Attachment #8533397 - Attachment is obsolete: true
Attachment #8618777 - Flags: review+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.