Bug 1581969 - Don’t activate the newSavedLogin trigger on accounts.firefox.com. r=jaws a=lizzard
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Sun, 22 Sep 2019 12:31:09 -0400
changeset 551977 ac10e9c0bc4885c3c0ed89db2473421f7417ffda
parent 551976 8ab819881b9166ec53fc9f72dd08b7daad1b4769
child 551978 5f7afbf21c841a9b5929f9a1d7fa91e4a9e8880f
push id12012
push usermozilla@noorenberghe.ca
push dateSun, 22 Sep 2019 18:20:05 +0000
treeherdermozilla-beta@ac10e9c0bc48 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, lizzard
bugs1581969
milestone70.0
Bug 1581969 - Don’t activate the newSavedLogin trigger on accounts.firefox.com. r=jaws a=lizzard The user may be in the process of setting up Sync so prompting to setup login Sync from a CFR would be untimely. Differential Revision: https://phabricator.services.mozilla.com/D46252
browser/components/newtab/lib/ASRouterTriggerListeners.jsm
--- a/browser/components/newtab/lib/ASRouterTriggerListeners.jsm
+++ b/browser/components/newtab/lib/ASRouterTriggerListeners.jsm
@@ -420,15 +420,21 @@ this.ASRouterTriggerListeners = new Map(
           Services.obs.removeObserver(this, "LoginStats:NewSavedPassword");
 
           this._initialized = false;
           this._triggerHandler = null;
         }
       },
 
       observe(aSubject, aTopic, aData) {
+        if (aSubject.currentURI.asciiHost === "accounts.firefox.com") {
+          // Don't notify about saved logins on the FxA login origin since this
+          // trigger is used to promote login Sync and getting a recommendation
+          // to enable Sync during the sign up process is a bad UX.
+          return;
+        }
         this._triggerHandler(aSubject, { id: "newSavedLogin" });
       },
     },
   ],
 ]);
 
 const EXPORTED_SYMBOLS = ["ASRouterTriggerListeners"];