Bug 1369296 - show onboarding overlay in about:home;r=mossop,rexboy
authorgasolin <gasolin@gmail.com>
Thu, 01 Jun 2017 16:19:24 +0800
changeset 412448 83fd589229702dbddee7c3f98cd3b8a8d5b48321
parent 412447 da079ac30069792ea0c0331c2980b68b0f3c8a64
child 412449 c552b68a1c94a677bd05102543db5fca68b5012a
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop, rexboy
bugs1369296
milestone55.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 1369296 - show onboarding overlay in about:home;r=mossop,rexboy MozReview-Commit-ID: DSc35nFt36r
browser/app/profile/firefox.js
browser/extensions/onboarding/content/onboarding.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1670,9 +1670,9 @@ pref("browser.sessionstore.restore_tabs_
 #ifdef NIGHTLY_BUILD
 pref("urlclassifier.malwareTable", "goog-malware-shavar,goog-unwanted-shavar,goog-malware-proto,goog-unwanted-proto,test-malware-simple,test-unwanted-simple");
 pref("urlclassifier.phishTable", "goog-phish-shavar,goog-phish-proto,test-phish-simple");
 #endif
 
 pref("browser.suppress_first_window_animation", true);
 
 // Preferences for Photon onboarding system extension
-pref("browser.onboarding.disabled", false);
+pref("browser.onboarding.enabled", true);
--- a/browser/extensions/onboarding/content/onboarding.js
+++ b/browser/extensions/onboarding/content/onboarding.js
@@ -5,21 +5,22 @@
 /* global content */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 Cu.import("resource://gre/modules/Services.jsm");
 
 const ONBOARDING_CSS_URL = "resource://onboarding/onboarding.css";
+const ABOUT_HOME_URL = "about:home";
 const ABOUT_NEWTAB_URL = "about:newtab";
 
 /**
  * The script won't be initialized if we turned off onboarding by
- * setting "browser.onboarding.disabled" to true.
+ * setting "browser.onboarding.enabled" to false.
  */
 class Onboarding {
   constructor(contentWindow) {
     this.init(contentWindow);
   }
 
   async init(contentWindow) {
     this._window = contentWindow;
@@ -42,17 +43,17 @@ class Onboarding {
     switch (evt.target.id) {
       case "onboarding-overlay-icon":
       case "onboarding-tour-close-btn":
       // If the clicking target is directly on the outer-most overlay,
       // that means clicking outside the tour content area.
       // Let's toggle the overlay.
       case "onboarding-overlay":
         this.toggleOverlay();
-      break;
+        break;
     }
   }
 
   destroy() {
     this._overlayIcon.remove();
     this._overlay.remove();
   }
 
@@ -98,16 +99,17 @@ class Onboarding {
       link.addEventListener("load", resolve);
       doc.head.appendChild(link);
     });
   }
 }
 
 addEventListener("load", function(evt) {
   // Load onboarding module only when we enable it.
-  if (content.location.href == ABOUT_NEWTAB_URL &&
-      !Services.prefs.getBoolPref("browser.onboarding.disabled")) {
+  if ((content.location.href == ABOUT_NEWTAB_URL ||
+       content.location.href == ABOUT_HOME_URL) &&
+      Services.prefs.getBoolPref("browser.onboarding.enabled", false)) {
 
     content.requestIdleCallback(() => {
       new Onboarding(content);
     });
   }
 }, true);