1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

MutationObserver failed in some instances

Fixes #354
This commit is contained in:
kkapsner 2019-05-29 20:48:56 +02:00
parent 46ba7c666b
commit 579b778062
2 changed files with 6 additions and 2 deletions

View file

@ -123,8 +123,11 @@
var observer = new MutationObserver(allCallback);
var observing = false;
function observe(){
if (!observing){
observer.observe(window.document.documentElement, {subtree: true, childList: true});
if (
!observing &&
window.document
){
observer.observe(window.document, {subtree: true, childList: true});
observing = true;
}
}