diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/js/contentscript-end.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index 776862f..16d0cbf 100644 --- a/src/js/contentscript-end.js +++ b/src/js/contentscript-end.js @@ -474,13 +474,12 @@ var uBlockCollapser = (function() { var elem, shadow; while ( i-- ) { elem = elems[i]; - shadow = elem.shadowRoot; + // https://github.com/gorhill/uBlock/issues/762 + // Always hide using inline style. + elem.style.setProperty('display', 'none', 'important'); // 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'); - } + if ( elem.shadowRoot !== null ) { continue; } // https://github.com/gorhill/uBlock/pull/555 @@ -490,7 +489,6 @@ var uBlockCollapser = (function() { shadow = elem.createShadowRoot(); shadow.className = sessionId; } catch (ex) { - elem.style.setProperty('display', 'none', 'important'); } } }; |