Move cardholder containsOptions to CC constants

This commit is contained in:
Daniel James Smith 2022-01-02 16:09:28 +01:00
parent 643fc17151
commit 3bfddd0043
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 9 additions and 1 deletions

View File

@ -383,7 +383,7 @@ export default class AutofillService implements AutofillServiceInterface {
// ref https://developers.google.com/web/fundamentals/design-and-ux/input/forms/
if (!fillFields.cardholderName && this.isFieldMatch(f[attr],
CreditCardAutoFillConstants.CardHolderFieldNames,
['cc-name', 'card-name', 'cardholder-name', 'cardholder', 'tbName'])) {
CreditCardAutoFillConstants.CardHolderFieldNameValues)) {
fillFields.cardholderName = f;
break;
} else if (!fillFields.number && this.isFieldMatch(f[attr],

View File

@ -66,6 +66,14 @@ export class CreditCardAutoFillConstants {
"nom",
];
static readonly CardHolderFieldNameValues: string[] = [
"cc-name",
"card-name",
"cardholder-name",
"cardholder",
"tbName",
];
static readonly CardNumberFieldNames: string[] = [
"cc-number",
"cc-num",