Bug 1291346 - Fix updateLoginAnchor's search for form logins and delay it until the pref check. r=dolske
It's possible to write a test for this but that's already covered by
bug 1164018 and this code should be removed in
bug 1286718.
MozReview-Commit-ID: 1LUG3MM4Op3
--- a/toolkit/components/passwordmgr/LoginManagerParent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm
@@ -504,37 +504,37 @@ var LoginManagerParent = {
() => this.updateLoginAnchor(browser),
ANCHOR_DELAY_MS
);
}
state.anchorDeferredTask.arm();
},
updateLoginAnchor: Task.async(function* (browser) {
+ // Once this preference is removed, this version of the fill doorhanger
+ // should be enabled for Desktop only, and not for Android or B2G.
+ if (!Services.prefs.getBoolPref("signon.ui.experimental")) {
+ return;
+ }
+
// Copy the state to use for this execution of the task. These will not
// change during this execution of the asynchronous function, but in case a
// change happens in the state, the function will be retriggered.
let { loginFormOrigin, loginFormPresent } = this.stateForBrowser(browser);
yield Services.logins.initializationPromise;
// Check if there are form logins for the site, ignoring formSubmitURL.
let hasLogins = loginFormOrigin &&
LoginHelper.searchLoginsWithObject({
- formSubmitURL: "",
+ httpRealm: null,
hostname: loginFormOrigin,
schemeUpgrades: LoginHelper.schemeUpgrades,
}).length > 0;
- // Once this preference is removed, this version of the fill doorhanger
- // should be enabled for Desktop only, and not for Android or B2G.
- if (!Services.prefs.getBoolPref("signon.ui.experimental")) {
- return;
- }
-
let showLoginAnchor = loginFormPresent || hasLogins;
let fillDoorhanger = LoginDoorhangers.FillDoorhanger.find({ browser });
if (fillDoorhanger) {
if (!showLoginAnchor) {
fillDoorhanger.remove();
return;
}