Bug 1548626 - Delay showing the Privacy-UI onboarding by 30 min for new users. r=johannh
☠☠ backed out by 22980cfa0285 ☠ ☠
authorErica Wright <ewright@mozilla.com>
Thu, 02 May 2019 23:17:12 +0000
changeset 531215 0ef6e3e9552df27c04a2e839d686aaa45ef094e2
parent 531214 3edbe004f8ac490b35bedf15009351b7b9e92384
child 531216 c2f648fbcbf18415b631252995edf38301c3063e
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1548626
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1548626 - Delay showing the Privacy-UI onboarding by 30 min for new users. r=johannh Wait 30 min after a new profile is created before showing the onbording. Differential Revision: https://phabricator.services.mozilla.com/D29762
browser/app/profile/firefox.js
browser/base/content/browser-contentblocking.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1626,16 +1626,18 @@ pref("browser.contentblocking.reportBrea
 // Show report breakage for tracking cookies in all channels.
 pref("browser.contentblocking.rejecttrackers.reportBreakage.enabled", true);
 
 pref("browser.contentblocking.reportBreakage.url", "https://tracking-protection-issues.herokuapp.com/new");
 
 pref("browser.contentblocking.introCount", 0);
 
 pref("browser.contentblocking.maxIntroCount", 5);
+// 1800 = 30 min in seconds
+pref("browser.contentblocking.introDelaySeconds", 1800);
 
 pref("privacy.trackingprotection.introURL", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/content-blocking/start/");
 
 // Always enable newtab segregation using containers
 pref("privacy.usercontext.about_newtab_segregation.enabled", true);
 // Enable Contextual Identity Containers
 #ifdef NIGHTLY_BUILD
 pref("privacy.userContext.enabled", true);
--- a/browser/base/content/browser-contentblocking.js
+++ b/browser/base/content/browser-contentblocking.js
@@ -1134,17 +1134,21 @@ var ContentBlocking = {
       this.iconBox.removeAttribute("animate");
     // Only play the animation when the shield is not already shown on the page (the visibility
     // of the shield based on this onSecurityChange be determined afterwards).
     } else if (anyBlocking && !this.iconBox.hasAttribute("active")) {
       this.iconBox.setAttribute("animate", "true");
 
       if (!isBrowserPrivate) {
         let introCount = Services.prefs.getIntPref(this.prefIntroCount);
-        if (introCount < this.MAX_INTROS && !this.anyOtherWindowHasTour()) {
+        let installStamp = Services.prefs.getIntPref(
+          "browser.laterrun.bookkeeping.profileCreationTime", Date.now() / 1000);
+        let delayLength = Services.prefs.getIntPref("browser.contentblocking.introDelaySeconds");
+        let delayFulfilled = delayLength < (Date.now() / 1000 - installStamp);
+        if (introCount < this.MAX_INTROS && !this.anyOtherWindowHasTour() && delayFulfilled) {
           Services.prefs.setIntPref(this.prefIntroCount, ++introCount);
           Services.prefs.savePrefFile(null);
           this.showIntroPanel();
         }
       }
     }
 
     // We consider the shield state "active" when some kind of blocking activity