From f3c8c6d59af62c991f975e201d83fe00f2378068 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Tue, 25 Feb 2020 13:47:07 +0200 Subject: [PATCH] TOTP icon improvements --- keepassxc-browser/content/totp-field.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/keepassxc-browser/content/totp-field.js b/keepassxc-browser/content/totp-field.js index 15ca866..9c71280 100644 --- a/keepassxc-browser/content/totp-field.js +++ b/keepassxc-browser/content/totp-field.js @@ -1,6 +1,7 @@ 'use strict'; const MINIMUM_SIZE = 60; +const ignoreRegex = /^(zip|postal).*code$/i; var kpxcTOTPIcons = {}; kpxcTOTPIcons.icons = []; @@ -28,10 +29,13 @@ class TOTPFieldIcon extends Icon { TOTPFieldIcon.prototype.initField = function(field) { if (!field + || field.type === 'password' || field.getAttribute('kpxc-totp-field') === 'true' || field.offsetWidth < MINIMUM_SIZE || field.size < 2 - || (field.maxLength > 0 && field.maxLength < 4)) { + || (field.maxLength > 0 && field.maxLength < 4) + || field.id.match(ignoreRegex) + || field.name.match(ignoreRegex)) { return; }