Move CVV fieldnames to CC constants

This commit is contained in:
Daniel James Smith 2022-01-02 14:16:27 +01:00
parent bb294ac792
commit 7e5b50a6cb
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 25 additions and 3 deletions

View File

@ -411,9 +411,7 @@ export default class AutofillService implements AutofillServiceInterface {
fillFields.expYear = f;
break;
} else if (!fillFields.code && this.isFieldMatch(f[attr],
['cvv', 'cvc', 'cvv2', 'cc-csc', 'cc-cvv', 'card-csc', 'card-cvv', 'cvd', 'cid', 'cvc2',
'cnv', 'cvn2', 'cc-code', 'card-code', 'code-securite', 'security-code', 'crypto',
'card-verif', 'verification-code', 'csc', 'ccv'])) {
CreditCardAutoFillConstants.CVVFieldNames)) {
fillFields.code = f;
break;
} else if (!fillFields.brand && this.isFieldMatch(f[attr],

View File

@ -138,6 +138,30 @@ export class CreditCardAutoFillConstants {
"date-y",
];
static readonly CVVFieldNames: string[] = [
"cvv",
"cvc",
"cvv2",
"cc-csc",
"cc-cvv",
"card-csc",
"card-cvv",
"cvd",
"cid",
"cvc2",
"cnv",
"cvn2",
"cc-code",
"card-code",
"code-securite",
"security-code",
"crypto",
"card-verif",
"verification-code",
"csc",
"ccv",
];
// Each index represents a language. These three arrays should all be the same length.
// 0: English, 1: Danish, 2: German/Dutch, 3: French/Spanish/Italian, 4: Russian, 5: Portuguese
static readonly MonthAbbr = ["mm", "mm", "mm", "mm", "mm", "mm"];