diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index 180fa8094..e6047f022 100644 --- a/src/js/contentscript-end.js +++ b/src/js/contentscript-end.js @@ -467,7 +467,12 @@ var uBlockCollapser = (function() { while ( i-- ) { elem = elems[i]; shadow = elem.shadowRoot; - if ( shadow !== null && shadow.className === sessionId ) { + // https://www.chromestatus.com/features/4668884095336448 + // "Multiple shadow roots is being deprecated." + if ( shadow !== null ) { + if ( shadow.className !== sessionId ) { + elem.style.setProperty('display', 'none', 'important'); + } continue; } // https://github.com/gorhill/uBlock/pull/555 diff --git a/src/js/contentscript-start.js b/src/js/contentscript-start.js index f45d904e9..6a8ceff2b 100644 --- a/src/js/contentscript-start.js +++ b/src/js/contentscript-start.js @@ -178,7 +178,12 @@ var hideElements = function(selectors) { while ( i-- ) { elem = elems[i]; shadow = elem.shadowRoot; - if ( shadow !== null && shadow.className === sessionId ) { + // https://www.chromestatus.com/features/4668884095336448 + // "Multiple shadow roots is being deprecated." + if ( shadow !== null ) { + if ( shadow.className !== sessionId ) { + elem.style.setProperty('display', 'none', 'important'); + } continue; } // https://github.com/gorhill/uBlock/pull/555