[PM-8833] Working through fixing field qualification issues

This commit is contained in:
Cesar Gonzalez 2024-09-30 10:45:14 -05:00
parent a2f2e6b9fd
commit 7efae38745
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF
3 changed files with 5 additions and 6 deletions

View File

@ -3286,10 +3286,6 @@ describe("AutofillService", () => {
);
expect(AutofillService.forCustomFieldsOnly).toHaveBeenCalledWith(excludedField);
expect(AutofillService["isExcludedFieldType"]).toHaveBeenCalledWith(
excludedField,
AutoFillConstants.ExcludedAutofillTypes,
);
expect(AutofillService["isFieldMatch"]).not.toHaveBeenCalled();
expect(value.script).toStrictEqual([]);
});

View File

@ -1866,7 +1866,10 @@ export default class AutofillService implements AutofillServiceInterface {
*/
private excludeFieldFromIdentityFill(field: AutofillField): boolean {
return (
AutofillService.isExcludedFieldType(field, AutoFillConstants.ExcludedAutofillTypes) ||
AutofillService.isExcludedFieldType(field, [
"password",
...AutoFillConstants.ExcludedAutofillTypes,
]) ||
AutoFillConstants.ExcludedIdentityAutocompleteTypes.has(field.autoCompleteType) ||
!field.viewable
);

View File

@ -35,7 +35,7 @@ export class InlineMenuFieldQualificationService
private autofillFieldKeywordsMap: AutofillKeywordsMap = new WeakMap();
private submitButtonKeywordsMap: SubmitButtonKeywordsMap = new WeakMap();
private autocompleteDisabledValues = new Set(["off", "false"]);
private newFieldKeywords = new Set(["new", "change", "neue", "ändern"]);
private newFieldKeywords = new Set(["new", "neue", "ändern"]);
private accountCreationFieldKeywords = [
...new Set(["register", "registration", "create", "confirm", ...this.newFieldKeywords]),
];