diff --git a/keepassxc-browser/content/totp-field.js b/keepassxc-browser/content/totp-field.js index cd0874d..f471d2c 100644 --- a/keepassxc-browser/content/totp-field.js +++ b/keepassxc-browser/content/totp-field.js @@ -1,6 +1,6 @@ 'use strict'; -const ignoreRegex = /(bank|coupon|postal|user|zip|promo).*code|(en|de)code(d|r)*|comment|author|error/i; +const ignoreRegex = /(bank|coupon|post(al)?|user|zip|promo).*code|(en|de)code(d|r)*|comment|author|error/i; const ignoredTypes = [ 'email', 'password', 'username' ]; const allowedInputTypes = [ 'number', 'password', 'tel', 'text' ]; diff --git a/tests/tests.js b/tests/tests.js index 15ab3f8..72dc07f 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -62,6 +62,8 @@ async function testTotpFields() { [ '', { id: '2fa', type: 'text', maxLength: '12' }, 'Ignore if field maxLength too long', false ], [ '', { id: 'promocode', type: 'text', }, 'promocode id is not acceptable', false ], [ '', { id: 'Promotional Code', type: 'text', }, 'Promotional Code id is not acceptable', false ], + [ '', { id: 'postcode', type: 'text', }, 'postcode id is not acceptable', false ], + [ '', { id: 'postalcode', type: 'text', }, 'postalcode id is not acceptable', false ], [ '', { id: 'encode', type: 'text', }, 'encode id is not acceptable', false ], [ '', { id: 'encodedText', type: 'text', }, 'encodedText is not acceptable', false ], [ '', { id: 'decoder', type: 'text', }, 'decoder id is not acceptable', false ],