mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add overlay exceptions feature
This commit is contained in:
parent
bbff228b40
commit
d1f6f611a6
2 changed files with 18 additions and 0 deletions
|
|
@ -235,6 +235,20 @@ kpxcSites.popupExceptionFound = function(combinations) {
|
|||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles exceptions where a certain element is set as a popover, and it prevents input field detections.
|
||||
* @param {object} elem Popover element
|
||||
* @returns {boolean} True if exception found
|
||||
*/
|
||||
kpxcSites.overlayExceptionFound = function(elem) {
|
||||
if (document.location.href?.startsWith('https://github.com/login')
|
||||
&& elem?.nodeName === 'TOOL-TIP' && elem?.baseURI === 'https://github.com/login') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles a few exceptions for certain sites where Username Icon is not placed properly.
|
||||
* @param {number} left Absolute left position of the icon
|
||||
|
|
|
|||
|
|
@ -495,6 +495,10 @@ kpxcFields.isTopElement = function(elem, rect) {
|
|||
|
||||
// Check for popup overlays
|
||||
for (const overlay of kpxcFields.overlays ?? []) {
|
||||
if (kpxcSites.overlayExceptionFound(overlay)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const overlayRect = overlay?.getBoundingClientRect();
|
||||
if (overlayRect && elementsOverlap(rect, overlayRect)) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue