From cc17a77b0ac69ba73299148e2a710dcbd5069a21 Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 28 Sep 2015 15:51:02 -0400 Subject: this fixes #762 --- src/js/contentscript-start.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/js/contentscript-start.js b/src/js/contentscript-start.js index 3d78a9f..6397a1e 100644 --- a/src/js/contentscript-start.js +++ b/src/js/contentscript-start.js @@ -196,13 +196,12 @@ var hideElements = function(selectors) { 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 @@ -212,7 +211,6 @@ var hideElements = function(selectors) { shadow = elem.createShadowRoot(); shadow.className = sessionId; } catch (ex) { - elem.style.setProperty('display', 'none', 'important'); } } }; -- cgit v1.1