mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #212 from keepassxreboot/ignore_svg_elements
Ignore SVG elements
This commit is contained in:
commit
be3c773580
1 changed files with 19 additions and 2 deletions
|
|
@ -1256,8 +1256,25 @@ 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.nodeName === 'svg' ||
|
||||
target.nodeName === 'g' ||
|
||||
(target.parentNode &&
|
||||
(target.parentNode.nodeName === 'svg' || target.parentNode.nodeName === 'g'))) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -1282,7 +1299,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