From 40a035f3384b22ea55b993b125640196182387a3 Mon Sep 17 00:00:00 2001 From: Emanuele Feliziani Date: Tue, 31 Oct 2023 09:27:50 +0100 Subject: [PATCH] Better fix Signed-off-by: Emanuele Feliziani --- dist/autofill-debug.js | 6 ++++-- dist/autofill.js | 6 ++++-- .../__generated__/compiled-matching-config.js | 2 +- src/Form/matching-config/matching-config-source.js | 2 +- src/Form/matching.js | 3 ++- src/Form/test-cases/pcsretirementcom_login.html | 3 ++- swift-package/Resources/assets/autofill-debug.js | 6 ++++-- swift-package/Resources/assets/autofill.js | 6 ++++-- 8 files changed, 22 insertions(+), 12 deletions(-) diff --git a/dist/autofill-debug.js b/dist/autofill-debug.js index 36be387dc..1469cd992 100644 --- a/dist/autofill-debug.js +++ b/dist/autofill-debug.js @@ -12332,7 +12332,7 @@ const matchingConfiguration = exports.matchingConfiguration = { }, password: { match: /password|passwort|kennwort|wachtwoord|mot de passe|clave|contraseña|lösenord/iu, - skip: /email|one-time|error|hint|username/iu, + skip: /email|one-time|error|hint/iu, forceUnknown: /captcha|mfa|2fa|two factor|otp|pin/iu }, username: { @@ -12869,7 +12869,9 @@ class Matching { if (this.subtypeFromMatchers('password', input)) { // Any other input type is likely a false match // Arguably "text" should be as well, but it can be used for password reveal fields - if (['password', 'text'].includes(input.type) && input.name !== 'email' && input.placeholder !== 'Username') { + if (['password', 'text'].includes(input.type) && input.name !== 'email' && + // pcsretirement.com, improper use of the for attribute + input.name !== 'Username') { return 'credentials.password'; } } diff --git a/dist/autofill.js b/dist/autofill.js index 9a4c9a8f4..ca382cd2a 100644 --- a/dist/autofill.js +++ b/dist/autofill.js @@ -8166,7 +8166,7 @@ const matchingConfiguration = exports.matchingConfiguration = { }, password: { match: /password|passwort|kennwort|wachtwoord|mot de passe|clave|contraseña|lösenord/iu, - skip: /email|one-time|error|hint|username/iu, + skip: /email|one-time|error|hint/iu, forceUnknown: /captcha|mfa|2fa|two factor|otp|pin/iu }, username: { @@ -8703,7 +8703,9 @@ class Matching { if (this.subtypeFromMatchers('password', input)) { // Any other input type is likely a false match // Arguably "text" should be as well, but it can be used for password reveal fields - if (['password', 'text'].includes(input.type) && input.name !== 'email' && input.placeholder !== 'Username') { + if (['password', 'text'].includes(input.type) && input.name !== 'email' && + // pcsretirement.com, improper use of the for attribute + input.name !== 'Username') { return 'credentials.password'; } } diff --git a/src/Form/matching-config/__generated__/compiled-matching-config.js b/src/Form/matching-config/__generated__/compiled-matching-config.js index ceedc221d..bb768c2a7 100644 --- a/src/Form/matching-config/__generated__/compiled-matching-config.js +++ b/src/Form/matching-config/__generated__/compiled-matching-config.js @@ -245,7 +245,7 @@ const matchingConfiguration = { }, password: { match: /password|passwort|kennwort|wachtwoord|mot de passe|clave|contraseña|lösenord/iu, - skip: /email|one-time|error|hint|username/iu, + skip: /email|one-time|error|hint/iu, forceUnknown: /captcha|mfa|2fa|two factor|otp|pin/iu }, username: { diff --git a/src/Form/matching-config/matching-config-source.js b/src/Form/matching-config/matching-config-source.js index cfe5141e2..006ab34ab 100644 --- a/src/Form/matching-config/matching-config-source.js +++ b/src/Form/matching-config/matching-config-source.js @@ -264,7 +264,7 @@ const matchingConfiguration = { '|clave|contraseña' + // Swedish '|lösenord', - skip: 'email|one-time|error|hint|username', + skip: 'email|one-time|error|hint', forceUnknown: 'captcha|mfa|2fa|two factor|otp|pin' }, username: { diff --git a/src/Form/matching.js b/src/Form/matching.js index e5fdb6c1f..bb488549d 100644 --- a/src/Form/matching.js +++ b/src/Form/matching.js @@ -258,7 +258,8 @@ class Matching { if ( ['password', 'text'].includes(input.type) && input.name !== 'email' && - input.placeholder !== 'Username' + // pcsretirement.com, improper use of the for attribute + input.name !== 'Username' ) { return 'credentials.password' } diff --git a/src/Form/test-cases/pcsretirementcom_login.html b/src/Form/test-cases/pcsretirementcom_login.html index e1636b896..d5e982d4f 100644 --- a/src/Form/test-cases/pcsretirementcom_login.html +++ b/src/Form/test-cases/pcsretirementcom_login.html @@ -51,4 +51,5 @@ - + + diff --git a/swift-package/Resources/assets/autofill-debug.js b/swift-package/Resources/assets/autofill-debug.js index 36be387dc..1469cd992 100644 --- a/swift-package/Resources/assets/autofill-debug.js +++ b/swift-package/Resources/assets/autofill-debug.js @@ -12332,7 +12332,7 @@ const matchingConfiguration = exports.matchingConfiguration = { }, password: { match: /password|passwort|kennwort|wachtwoord|mot de passe|clave|contraseña|lösenord/iu, - skip: /email|one-time|error|hint|username/iu, + skip: /email|one-time|error|hint/iu, forceUnknown: /captcha|mfa|2fa|two factor|otp|pin/iu }, username: { @@ -12869,7 +12869,9 @@ class Matching { if (this.subtypeFromMatchers('password', input)) { // Any other input type is likely a false match // Arguably "text" should be as well, but it can be used for password reveal fields - if (['password', 'text'].includes(input.type) && input.name !== 'email' && input.placeholder !== 'Username') { + if (['password', 'text'].includes(input.type) && input.name !== 'email' && + // pcsretirement.com, improper use of the for attribute + input.name !== 'Username') { return 'credentials.password'; } } diff --git a/swift-package/Resources/assets/autofill.js b/swift-package/Resources/assets/autofill.js index 9a4c9a8f4..ca382cd2a 100644 --- a/swift-package/Resources/assets/autofill.js +++ b/swift-package/Resources/assets/autofill.js @@ -8166,7 +8166,7 @@ const matchingConfiguration = exports.matchingConfiguration = { }, password: { match: /password|passwort|kennwort|wachtwoord|mot de passe|clave|contraseña|lösenord/iu, - skip: /email|one-time|error|hint|username/iu, + skip: /email|one-time|error|hint/iu, forceUnknown: /captcha|mfa|2fa|two factor|otp|pin/iu }, username: { @@ -8703,7 +8703,9 @@ class Matching { if (this.subtypeFromMatchers('password', input)) { // Any other input type is likely a false match // Arguably "text" should be as well, but it can be used for password reveal fields - if (['password', 'text'].includes(input.type) && input.name !== 'email' && input.placeholder !== 'Username') { + if (['password', 'text'].includes(input.type) && input.name !== 'email' && + // pcsretirement.com, improper use of the for attribute + input.name !== 'Username') { return 'credentials.password'; } }