diff options
author | gorhill <rhill@raymondhill.net> | 2015-09-28 15:51:02 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-09-28 15:51:02 -0400 |
commit | cc17a77b0ac69ba73299148e2a710dcbd5069a21 (patch) | |
tree | 5906418d9a112b8c773f603b22c6f8b5ed8668e2 /src | |
parent | 34b58178bc7abafb55b6c2c1fd69c80f1be5b938 (diff) | |
download | uBlock-cc17a77b0ac69ba73299148e2a710dcbd5069a21.zip uBlock-cc17a77b0ac69ba73299148e2a710dcbd5069a21.tar.gz uBlock-cc17a77b0ac69ba73299148e2a710dcbd5069a21.tar.bz2 |
this fixes #762
Diffstat (limited to 'src')
-rw-r--r-- | src/js/contentscript-start.js | 10 |
1 files changed, 4 insertions, 6 deletions
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'); } } }; |