Move cardholder fieldnames to CC constants

This commit is contained in:
Daniel James Smith 2022-01-02 15:43:29 +01:00
parent ff6e63a335
commit 37948db899
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 10 additions and 1 deletions

View File

@ -382,7 +382,7 @@ export default class AutofillService implements AutofillServiceInterface {
// ref https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
// ref https://developers.google.com/web/fundamentals/design-and-ux/input/forms/
if (!fillFields.cardholderName && this.isFieldMatch(f[attr],
['cc-name', 'card-name', 'cardholder-name', 'cardholder', 'name', 'nom'],
CreditCardAutoFillConstants.CardHolderFieldNames,
['cc-name', 'card-name', 'cardholder-name', 'cardholder', 'tbName'])) {
fillFields.cardholderName = f;
break;

View File

@ -50,6 +50,15 @@ export class CreditCardAutoFillConstants {
"label-right",
];
static readonly CardHolderFieldNames: string[] = [
"cc-name",
"card-name",
"cardholder-name",
"cardholder",
"name",
"nom",
];
static readonly ExpiryMonthFieldNames: string[] = [
"exp-month",
"cc-exp-month",