Fix TOTP field maxLength comparison

This commit is contained in:
varjolintu 2020-04-05 13:35:01 +03:00
parent 1af105b6eb
commit bab175af04
2 changed files with 5 additions and 2 deletions

View file

@ -34,7 +34,7 @@ TOTPFieldIcon.prototype.initField = function(field) {
|| field.getAttribute('kpxc-totp-field') === 'true'
|| field.offsetWidth < MINIMUM_SIZE
|| field.size < 2
|| (field.maxLength > 0 && field.maxLength < 4)
|| (field.maxLength > 0 && (field.maxLength < 6 || field.maxLength > 8))
|| field.id.match(ignoreRegex)
|| field.name.match(ignoreRegex)) {
return;

View file

@ -41,7 +41,10 @@ class UsernameFieldIcon extends Icon {
}
UsernameFieldIcon.prototype.initField = function(field) {
if (!field || field.getAttribute('kpxc-username-field') === 'true' || !kpxcFields.isVisible(field)) {
if (!field
|| field.getAttribute('kpxc-username-field') === 'true'
|| field.getAttribute('kpxc-totp-field') === 'true'
|| !kpxcFields.isVisible(field)) {
return;
}