Add ignored types for TOTP field icons

This commit is contained in:
humanoid 2020-03-04 17:52:19 +02:00 committed by varjolintu
parent c24e5464f0
commit a8ffff991a

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