mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #798 from keepassxreboot/fix/totp_ignore_types
Add ignored types for TOTP field icons
This commit is contained in:
commit
be7b2db09e
1 changed files with 2 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
const MINIMUM_SIZE = 60;
|
const MINIMUM_SIZE = 60;
|
||||||
const ignoreRegex = /^(zip|postal).*code$/i;
|
const ignoreRegex = /^(zip|postal).*code$/i;
|
||||||
|
const ignoredTypes = [ 'email', 'password', 'username' ];
|
||||||
|
|
||||||
var kpxcTOTPIcons = {};
|
var kpxcTOTPIcons = {};
|
||||||
kpxcTOTPIcons.icons = [];
|
kpxcTOTPIcons.icons = [];
|
||||||
|
|
@ -29,7 +30,7 @@ class TOTPFieldIcon extends Icon {
|
||||||
|
|
||||||
TOTPFieldIcon.prototype.initField = function(field) {
|
TOTPFieldIcon.prototype.initField = function(field) {
|
||||||
if (!field
|
if (!field
|
||||||
|| field.type === 'password'
|
|| ignoredTypes.some(t => t === field.type)
|
||||||
|| field.getAttribute('kpxc-totp-field') === 'true'
|
|| field.getAttribute('kpxc-totp-field') === 'true'
|
||||||
|| field.offsetWidth < MINIMUM_SIZE
|
|| field.offsetWidth < MINIMUM_SIZE
|
||||||
|| field.size < 2
|
|| field.size < 2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue