mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Ignore SVG elements
This commit is contained in:
parent
6ba29a70f2
commit
38cf721c5b
1 changed files with 16 additions and 2 deletions
|
|
@ -1231,8 +1231,22 @@ cipObserverHelper.getId = function(target) {
|
|||
return target.classList.length === 0 ? target.id : target.classList;
|
||||
};
|
||||
|
||||
cipObserverHelper.handleObserverAdd = function(target) {
|
||||
cipObserverHelper.ignoredElement = function(target) {
|
||||
// Ignore SVG elements
|
||||
if (target.className && (target.nodeName !== 'svg' || target.parentNode.nodeName !== 'svg')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Ignore KeePassXC-Browser classes
|
||||
if (target.className && (target.className.includes('kpxc') || target.className.includes('ui-helper'))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
cipObserverHelper.handleObserverAdd = function(target) {
|
||||
if (cipObserverHelper.ignoredElement(target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1257,7 +1271,7 @@ cipObserverHelper.handleObserverAdd = function(target) {
|
|||
};
|
||||
|
||||
cipObserverHelper.handleObserverRemove = function(target) {
|
||||
if (target.className && (target.className.includes('kpxc') || target.className.includes('ui-helper'))) {
|
||||
if (cipObserverHelper.ignoredElement(target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue