From cb71fb494cd57bee3265164bb1ea9ed2ead2ee89 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 10 Dec 2020 12:51:26 -0500 Subject: [PATCH] Fix DOM watcher not reporting removal of elements Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1392 Regression from: - https://github.com/gorhill/uBlock/commit/6112a68faf46d89c58defdd9e14d4342747c9523 --- src/js/contentscript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/contentscript.js b/src/js/contentscript.js index fb5e1932e..3ce10096f 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -362,7 +362,7 @@ vAPI.SafeAnimationFrame = class { }; // https://github.com/chrisaljoudi/uBlock/issues/205 - // Do not handle added node directly from within mutation observer. + // Do not handle added node directly from within mutation observer. const observerHandler = function(mutations) { let i = mutations.length; while ( i-- ) { @@ -376,7 +376,7 @@ vAPI.SafeAnimationFrame = class { removedNodeLists.push(nodeList); } } - if ( addedNodeLists.length !== 0 || removedNodes ) { + if ( addedNodeLists.length !== 0 || removedNodeLists.length !== 0 ) { safeObserverHandlerTimer.start( addedNodeLists.length < 100 ? 1 : undefined );