From c209fd72de9f697df5e525a6e7e9418be6fcc653 Mon Sep 17 00:00:00 2001 From: David Gleich Date: Sat, 24 Oct 2020 13:01:03 +0200 Subject: [PATCH] Add some german input field names --- src/services/autofill.service.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index 74912f26dc..9a67f33fab 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -37,6 +37,20 @@ const UsernameFieldNames: string[] = [ // German 'benutzername', 'benutzer name', 'email adresse', 'e-mail adresse', 'benutzerid', 'benutzer id']; +const FirstnameFieldNames: string[] = [ + // English + 'f-name', 'first-name', 'given-name', 'first-n', + // German + 'vorname' +] + +const LastnameFieldNames: string[] = [ + // English + 'l-name', 'last-name', 's-name', 'surname', 'family-name', 'family-n', 'last-n', + // German + 'nachname', 'familienname' +] + const ExcludedAutofillTypes: string[] = ['radio', 'checkbox', 'hidden', 'file', 'button', 'image', 'reset', 'search']; // Each index represents a language. These three arrays should all be the same length. @@ -691,7 +705,7 @@ export default class AutofillService implements AutofillServiceInterface { fillFields.name = f; break; } else if (!fillFields.firstName && this.isFieldMatch(f[attr], - ['f-name', 'first-name', 'given-name', 'first-n'])) { + FirstnameFieldNames)) { fillFields.firstName = f; break; } else if (!fillFields.middleName && this.isFieldMatch(f[attr], @@ -699,7 +713,7 @@ export default class AutofillService implements AutofillServiceInterface { fillFields.middleName = f; break; } else if (!fillFields.lastName && this.isFieldMatch(f[attr], - ['l-name', 'last-name', 's-name', 'surname', 'family-name', 'family-n', 'last-n'])) { + LastnameFieldNames)) { fillFields.lastName = f; break; } else if (!fillFields.title && this.isFieldMatch(f[attr],