mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #716 from keepassxreboot/fix/totp_field_min_size
Ignore TOTP icons if the field is too small
This commit is contained in:
commit
f824aca2b3
1 changed files with 7 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const MINIMUM_SIZE = 60;
|
||||
|
||||
var kpxcTOTPIcons = {};
|
||||
kpxcTOTPIcons.icons = [];
|
||||
|
||||
|
|
@ -25,7 +27,11 @@ class TOTPFieldIcon extends Icon {
|
|||
};
|
||||
|
||||
TOTPFieldIcon.prototype.initField = function(field) {
|
||||
if (!field || field.getAttribute('kpxc-totp-field') === 'true') {
|
||||
if (!field
|
||||
|| field.getAttribute('kpxc-totp-field') === 'true'
|
||||
|| field.offsetWidth < MINIMUM_SIZE
|
||||
|| field.size < 2
|
||||
|| (field.maxLength > 0 && field.maxLength < 4)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue