mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
TOTP icon improvements
This commit is contained in:
parent
a9b4ce3e39
commit
f3c8c6d59a
1 changed files with 5 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const MINIMUM_SIZE = 60;
|
||||
const ignoreRegex = /^(zip|postal).*code$/i;
|
||||
|
||||
var kpxcTOTPIcons = {};
|
||||
kpxcTOTPIcons.icons = [];
|
||||
|
|
@ -28,10 +29,13 @@ class TOTPFieldIcon extends Icon {
|
|||
|
||||
TOTPFieldIcon.prototype.initField = function(field) {
|
||||
if (!field
|
||||
|| field.type === 'password'
|
||||
|| field.getAttribute('kpxc-totp-field') === 'true'
|
||||
|| field.offsetWidth < MINIMUM_SIZE
|
||||
|| field.size < 2
|
||||
|| (field.maxLength > 0 && field.maxLength < 4)) {
|
||||
|| (field.maxLength > 0 && field.maxLength < 4)
|
||||
|| field.id.match(ignoreRegex)
|
||||
|| field.name.match(ignoreRegex)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue