Bug 1560431 - Add pref for breach alerts in about:logins and disable it by default. r=groovecoder
authorJared Wein <jwein@mozilla.com>
Thu, 18 Jul 2019 16:24:31 +0000
changeset 483343 db2f5792cd6e3eda65468905c5a91f0e5b2fddc8
parent 483342 a79ff5d4f88ca6252947222fef97d9175f2feec4
child 483344 1b351d73797d0c27ec0f0f8feb69fecd5a3644d9
push id36313
push useropoprus@mozilla.com
push dateThu, 18 Jul 2019 21:50:51 +0000
treeherdermozilla-central@5fceb8c496bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgroovecoder
bugs1560431
milestone70.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 1560431 - Add pref for breach alerts in about:logins and disable it by default. r=groovecoder Differential Revision: https://phabricator.services.mozilla.com/D38333
browser/app/profile/firefox.js
browser/components/aboutlogins/AboutLoginsParent.jsm
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1748,16 +1748,17 @@ pref("signon.schemeUpgrades", true);
 pref("signon.privateBrowsingCapture.enabled", true);
 pref("signon.showAutoCompleteFooter", true);
 #ifdef NIGHTLY_BUILD
 pref("signon.management.page.enabled", true);
 pref("signon.management.overrideURI", "about:logins?filter=%DOMAIN%");
 #else
 pref("signon.management.page.enabled", false);
 #endif
+pref("signon.management.page.breach-alerts.enabled", false);
 #ifdef NIGHTLY_BUILD
 // Bug 1563330 tracks shipping this by default.
 pref("signon.showAutoCompleteOrigins", true);
 pref("signon.includeOtherSubdomainsInLookup", true);
 #endif
 pref("signon.management.page.faqURL", "https://lockwise.firefox.com/faq.html");
 pref("signon.management.page.feedbackURL",
      "https://www.surveygizmo.com/s3/5036102/Lockwise-feedback?ver=%VERSION%");
--- a/browser/components/aboutlogins/AboutLoginsParent.jsm
+++ b/browser/components/aboutlogins/AboutLoginsParent.jsm
@@ -33,16 +33,22 @@ ChromeUtils.defineModuleGetter(
   this,
   "Services",
   "resource://gre/modules/Services.jsm"
 );
 
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   return LoginHelper.createLogger("AboutLoginsParent");
 });
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "BREACH_ALERTS_ENABLED",
+  "signon.management.page.breach-alerts.enabled",
+  false
+);
 
 const ABOUT_LOGINS_ORIGIN = "about:logins";
 const MASTER_PASSWORD_NOTIFICATION_ID = "master-password-login-required";
 
 const PRIVILEGEDABOUT_PROCESS_PREF =
   "browser.tabs.remote.separatePrivilegedContentProcess";
 const PRIVILEGEDABOUT_PROCESS_ENABLED = Services.prefs.getBoolPref(
   PRIVILEGEDABOUT_PROCESS_PREF,
@@ -177,27 +183,32 @@ var AboutLoginsParent = {
         ) {
           Services.obs.addObserver(this, "passwordmgr-crypto-login");
           Services.obs.addObserver(this, "passwordmgr-crypto-loginCanceled");
           Services.obs.addObserver(this, "passwordmgr-storage-changed");
         }
         this._subscribers.add(message.target);
 
         let messageManager = message.target.messageManager;
-        const logins = await this.getAllLogins();
-        messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins);
-        const breaches = await RemoteSettings("fxmonitor-breaches").get();
-        const breachesByLoginGUID = await this.getBreachesForLogins(
-          logins,
-          breaches
-        );
-        messageManager.sendAsyncMessage(
-          "AboutLogins:UpdateBreaches",
-          breachesByLoginGUID
-        );
+        this.getAllLogins().then(async logins => {
+          messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins);
+          if (!BREACH_ALERTS_ENABLED) {
+            return;
+          }
+
+          const breaches = await RemoteSettings("fxmonitor-breaches").get();
+          const breachesByLoginGUID = await this.getBreachesForLogins(
+            logins,
+            breaches
+          );
+          messageManager.sendAsyncMessage(
+            "AboutLogins:UpdateBreaches",
+            breachesByLoginGUID
+          );
+        });
         break;
       }
       case "AboutLogins:UpdateLogin": {
         let loginUpdates = message.data.login;
         let logins = LoginHelper.searchLoginsWithObject({
           guid: loginUpdates.guid,
         });
         if (logins.length != 1) {