mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #1368 from keepassxreboot/fix/check_for_form_opacity
Check for form opacity
This commit is contained in:
commit
178a5bedcf
2 changed files with 9 additions and 0 deletions
|
|
@ -631,7 +631,9 @@ kpxcFields.isVisible = function(elem) {
|
|||
|
||||
// Check CSS visibility
|
||||
const elemStyle = getComputedStyle(elem);
|
||||
const opacity = Number(elemStyle.opacity);
|
||||
if (elemStyle.visibility && (elemStyle.visibility === 'hidden' || elemStyle.visibility === 'collapse')
|
||||
|| (opacity < MIN_OPACITY || opacity > MAX_OPACITY)
|
||||
|| parseInt(elemStyle.width, 10) <= MIN_INPUT_FIELD_WIDTH_PX
|
||||
|| parseInt(elemStyle.height, 10) <= MIN_INPUT_FIELD_WIDTH_PX) {
|
||||
return false;
|
||||
|
|
@ -642,6 +644,11 @@ kpxcFields.isVisible = function(elem) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// If the input field belongs to a form, check its visibility also
|
||||
if (elem.nodeName === 'INPUT' && elem.form && !kpxcFields.isVisible(elem.form)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ const MIN_TOTP_INPUT_LENGTH = 6;
|
|||
const MAX_TOTP_INPUT_LENGTH = 10;
|
||||
const MIN_INPUT_FIELD_WIDTH_PX = 8;
|
||||
const MIN_INPUT_FIELD_OFFSET_WIDTH = 60;
|
||||
const MIN_OPACITY = 0.7;
|
||||
const MAX_OPACITY = 1;
|
||||
|
||||
const DatabaseState = {
|
||||
DISCONNECTED: 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue