Bug 1591462 - [4.2] Disable LoginManager storage for GeckoView. r=MattN
authorEugen Sawin <esawin@me73.com>
Mon, 11 Nov 2019 17:22:48 +0000
changeset 563346 300057f0ec79501c9fed624851b33865d7199baf
parent 563345 c6c5c9370ab08d153f8817709c7096dcce167fe6
child 563347 d3163cbe3b006771c30dc8f2cb625bb9cb89b362
push id12351
push userffxbld-merge
push dateMon, 02 Dec 2019 11:32:26 +0000
treeherdermozilla-beta@dba4410526a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1591462
milestone72.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 1591462 - [4.2] Disable LoginManager storage for GeckoView. r=MattN Differential Revision: https://phabricator.services.mozilla.com/D51723
mobile/android/app/geckoview-prefs.js
modules/libpref/init/all.js
toolkit/components/passwordmgr/LoginHelper.jsm
toolkit/components/passwordmgr/LoginManagerParent.jsm
--- a/mobile/android/app/geckoview-prefs.js
+++ b/mobile/android/app/geckoview-prefs.js
@@ -69,8 +69,14 @@ pref("browser.safebrowsing.features.cryp
 // Enable fingerprinting protection blocklist updates
 pref("browser.safebrowsing.features.fingerprinting.update", true);
 
 // Treat mouse as touch only on TV-ish devices
 pref("ui.android.mouse_as_touch", 2);
 
 // Fenix is currently not whitelisted for Web Authentication
 pref("security.webauth.webauthn_enable_android_fido2", false);
+
+// Enable login manager handling and events.
+pref("signon.rememberSignons", true);
+
+// Disable login manager storage.
+pref("signon.storeSignons", false);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3881,16 +3881,18 @@ pref("signon.storeWhenAutocompleteOff", 
 pref("signon.debug",                        false);
 pref("signon.recipes.path",                 "chrome://passwordmgr/content/recipes.json");
 pref("signon.schemeUpgrades",               false);
 pref("signon.includeOtherSubdomainsInLookup", false);
 // This temporarily prevents the master password to reprompt for autocomplete.
 pref("signon.masterPasswordReprompt.timeout_ms", 900000); // 15 Minutes
 pref("signon.showAutoCompleteFooter", false);
 pref("signon.showAutoCompleteOrigins", false);
+// Enable login manager storage.
+pref("signon.storeSignons", true);
 
 // Satchel (Form Manager) prefs
 pref("browser.formfill.debug",            false);
 pref("browser.formfill.enable",           true);
 pref("browser.formfill.expire_days",      180);
 pref("browser.formfill.agedWeight",       2);
 pref("browser.formfill.bucketSize",       1);
 pref("browser.formfill.maxTimeGroupings", 25);
--- a/toolkit/components/passwordmgr/LoginHelper.jsm
+++ b/toolkit/components/passwordmgr/LoginHelper.jsm
@@ -22,16 +22,17 @@ const { XPCOMUtils } = ChromeUtils.impor
 );
 
 /**
  * Contains functions shared by different Login Manager components.
  */
 this.LoginHelper = {
   debug: null,
   enabled: null,
+  storageEnabled: null,
   formlessCaptureEnabled: null,
   generationAvailable: null,
   generationEnabled: null,
   insecureAutofill: null,
   managementURI: null,
   privateBrowsingCaptureEnabled: null,
   schemeUpgrades: null,
   showAutoCompleteFooter: null,
@@ -45,16 +46,17 @@ this.LoginHelper = {
 
   updateSignonPrefs() {
     this.autofillForms = Services.prefs.getBoolPref("signon.autofillForms");
     this.autofillAutocompleteOff = Services.prefs.getBoolPref(
       "signon.autofillForms.autocompleteOff"
     );
     this.debug = Services.prefs.getBoolPref("signon.debug");
     this.enabled = Services.prefs.getBoolPref("signon.rememberSignons");
+    this.storageEnabled = Services.prefs.getBoolPref("signon.storeSignons");
     this.formlessCaptureEnabled = Services.prefs.getBoolPref(
       "signon.formlessCapture.enabled"
     );
     this.generationAvailable = Services.prefs.getBoolPref(
       "signon.generation.available"
     );
     this.generationEnabled = Services.prefs.getBoolPref(
       "signon.generation.enabled"
--- a/toolkit/components/passwordmgr/LoginManagerParent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm
@@ -581,16 +581,21 @@ class LoginManagerParent extends JSWindo
       let propBag = Cc["@mozilla.org/hash-property-bag;1"].createInstance(
         Ci.nsIWritablePropertyBag
       );
       propBag.setProperty("timeLastUsed", Date.now());
       propBag.setProperty("timesUsedIncrement", 1);
       Services.logins.modifyLogin(login, propBag);
     }
 
+    // If password storage is disabled, bail out.
+    if (!LoginHelper.storageEnabled) {
+      return;
+    }
+
     if (!Services.logins.getLoginSavingEnabled(origin)) {
       log("(form submission ignored -- saving is disabled for:", origin, ")");
       return;
     }
 
     let formLogin = new LoginInfo(
       origin,
       formActionOrigin,