Bug 1166995 - P5. Add a preference to control whether to capture login when a form is removed r=sfoster,tgiles

Add preference `signon.formRemovalCapture.enabled`, default on

Depends on D106027

Differential Revision: https://phabricator.services.mozilla.com/D108426
This commit is contained in:
Dimi Lee 2021-03-16 09:15:20 +00:00
Родитель edfbacc905
Коммит 43fbfae832
5 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -3664,6 +3664,7 @@ pref("signon.autofillForms.http", false);
pref("signon.autologin.proxy", false);
pref("signon.capture.inputChanges.enabled", true);
pref("signon.formlessCapture.enabled", true);
pref("signon.formRemovalCapture.enabled", true);
pref("signon.generation.available", true);
pref("signon.backup.enabled", true);
pref("signon.generation.confidenceThreshold", "0.75");

Просмотреть файл

@ -362,6 +362,7 @@ this.LoginHelper = {
enabled: null,
storageEnabled: null,
formlessCaptureEnabled: null,
formRemovalCaptureEnabled: null,
generationAvailable: null,
generationConfidenceThreshold: null,
generationEnabled: null,
@ -402,6 +403,9 @@ this.LoginHelper = {
this.formlessCaptureEnabled = Services.prefs.getBoolPref(
"signon.formlessCapture.enabled"
);
this.formRemovalCaptureEnabled = Services.prefs.getBoolPref(
"signon.formRemovalCapture.enabled"
);
this.generationAvailable = Services.prefs.getBoolPref(
"signon.generation.available"
);

Просмотреть файл

@ -355,7 +355,10 @@ const observer = {
// Infer form submission only when there has been an user interaction on the form
// or the formless password field.
if (!alreadyModified || !alreadyModifiedFormLessField) {
if (
LoginHelper.formRemovalCaptureEnabled &&
(!alreadyModified || !alreadyModifiedFormLessField)
) {
ownerDocument.setNotifyFetchSuccess(true);
}

Просмотреть файл

@ -21,12 +21,6 @@ let loadPromise = new Promise(resolve => {
});
add_task(async function setup() {
await SpecialPowers.pushPrefEnv({
set: [
["signon.formlessCapture.enabled", true],
],
});
info("Waiting for page and frame loads");
await loadPromise;

Просмотреть файл

@ -27,7 +27,7 @@ function submissionProcessed(...args) {
add_task(async function setup() {
await SpecialPowers.pushPrefEnv({
set: [
["signon.formlessCapture.enabled", true],
["signon.formRemovalCapture.enabled", true],
],
});