biancadanforth / tracking-protection-shield-study

A Shield study to determine the optimal messaging, if any, for Tracking Protection in Firefox.
0 stars 3 forks source link

Leave user alone in PB mode. Fixes #86. #101

Closed biancadanforth closed 6 years ago

biancadanforth commented 6 years ago

Basically there were 3 main entry points where UI could be added in a private window:

  1. Inside WindowWatchers.jsm; I now check for PB mode and don't add any window listeners to existing or new windows that are private.
  2. Inside WebRequest.onBeforeRequest: I now check for PB mode and don't call showPageAction or setPageActionCounter in private windows.
  3. Inside every frame script (Services.mm.loadFrameScript()); I now check for PB mode before any new tab page content is added.

Added 'win' argument to setPageActionCounter and showPageAction methods to check for PB mode within, as there are cases when both a private and non-private window are open and these methods can get called from the non-private window.

Though there is no UI in PB and no data collection, we do still block requests in PB and those blocked resources/ads/time saved quantities get added to the session totals visible in non-PB mode new tab pages.

Before:

86-beforepbmode

After:

86-afterpbmode

Also I noticed that in private windows, the 'new tab' page is 'about:privatebrowsing' instead of 'about:newtab'. This page shows users in our experimental branch (where we tell them TP is on) that TP is off. This can be confusing, and I should check and see if there's an easy way to override the new tab page in PB mode.

Before:

screen shot 2018-02-21 at 8 44 49 pm

After:

screen shot 2018-03-04 at 1 11 41 pm

biancadanforth commented 6 years ago

@jsavory, what do you think about the modified about:privatebrowsing page? Gregg was thinking we probably shouldn't touch it at all.