Merge pull request #1438 from gleichda/master

Add some german input field names
This commit is contained in:
Chad Scharf 2020-10-26 12:49:32 -04:00 committed by GitHub
commit 312cdbee3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 2 deletions

View File

@ -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],