From a8ffff991a43463e6d1e67f0805b176e3bcf3040 Mon Sep 17 00:00:00 2001 From: humanoid Date: Wed, 4 Mar 2020 17:52:19 +0200 Subject: [PATCH] Add ignored types for TOTP field icons --- keepassxc-browser/content/totp-field.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keepassxc-browser/content/totp-field.js b/keepassxc-browser/content/totp-field.js index 9c71280..ac4f7b4 100644 --- a/keepassxc-browser/content/totp-field.js +++ b/keepassxc-browser/content/totp-field.js @@ -2,6 +2,7 @@ const MINIMUM_SIZE = 60; const ignoreRegex = /^(zip|postal).*code$/i; +const ignoredTypes = [ 'email', 'password', 'username' ]; var kpxcTOTPIcons = {}; kpxcTOTPIcons.icons = []; @@ -29,7 +30,7 @@ class TOTPFieldIcon extends Icon { TOTPFieldIcon.prototype.initField = function(field) { if (!field - || field.type === 'password' + || ignoredTypes.some(t => t === field.type) || field.getAttribute('kpxc-totp-field') === 'true' || field.offsetWidth < MINIMUM_SIZE || field.size < 2