mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add extra checks for document.body
This commit is contained in:
parent
6cff401638
commit
7b14bed64e
2 changed files with 10 additions and 4 deletions
|
|
@ -1588,7 +1588,8 @@ kpxcObserverHelper.ignoredElement = function(target) {
|
|||
// Ignores all nodes that doesn't contain elements
|
||||
// Also ignore few Youtube-specific custom nodeNames
|
||||
kpxcObserverHelper.ignoredNode = function(target) {
|
||||
if (kpxcObserverHelper.ignoredNodeTypes.some(e => e === target.nodeType)
|
||||
if (!target
|
||||
||kpxcObserverHelper.ignoredNodeTypes.some(e => e === target.nodeType)
|
||||
|| kpxcObserverHelper.ignoredNodeNames.some(e => e === target.nodeName)
|
||||
|| target.nodeName.startsWith('YTMUSIC')
|
||||
|| target.nodeName.startsWith('YT-')) {
|
||||
|
|
@ -1647,7 +1648,9 @@ kpxcObserverHelper.initObserver = async function() {
|
|||
}
|
||||
});
|
||||
|
||||
kpxc.observer.observe(document.body, kpxcObserverHelper.observerConfig);
|
||||
if (document.body) {
|
||||
kpxc.observer.observe(document.body, kpxcObserverHelper.observerConfig);
|
||||
}
|
||||
};
|
||||
|
||||
MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
||||
|
|
|
|||
|
|
@ -55,10 +55,13 @@ class Icon {
|
|||
}
|
||||
|
||||
const kpxcUI = {};
|
||||
kpxcUI.bodyRect = document.body.getBoundingClientRect();
|
||||
kpxcUI.bodyStyle = getComputedStyle(document.body);
|
||||
kpxcUI.mouseDown = false;
|
||||
|
||||
if (document.body) {
|
||||
kpxcUI.bodyRect = document.body.getBoundingClientRect();
|
||||
kpxcUI.bodyStyle = getComputedStyle(document.body);
|
||||
}
|
||||
|
||||
// Wrapper for creating elements
|
||||
kpxcUI.createElement = function(type, classes, attributes, textContent) {
|
||||
const element = document.createElement(type);
|
||||
|
|
|
|||
Loading…
Reference in a new issue