Merge pull request #798 from keepassxreboot/fix/totp_ignore_types

Add ignored types for TOTP field icons
This commit is contained in:
Sami Vänttinen 2020-03-17 12:02:38 +02:00 committed by GitHub
commit be7b2db09e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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