diff options
author | gorhill <rhill@raymondhill.net> | 2015-08-13 19:36:54 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-08-13 19:36:54 -0400 |
commit | 118a7792ccd55adfa6fb663f491e3fe98f04e84c (patch) | |
tree | 20836d5b85b0805d816d96fa5a36d9c45cb01281 /src | |
parent | 47cf6384b28599e6bf007867655952d795349d67 (diff) | |
download | uBlock-118a7792ccd55adfa6fb663f491e3fe98f04e84c.zip uBlock-118a7792ccd55adfa6fb663f491e3fe98f04e84c.tar.gz uBlock-118a7792ccd55adfa6fb663f491e3fe98f04e84c.tar.bz2 |
multiple shadow roots is deprecated: https://www.chromestatus.com/features/4668884095336448
Diffstat (limited to 'src')
-rw-r--r-- | src/js/contentscript-end.js | 7 | ||||
-rw-r--r-- | src/js/contentscript-start.js | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index 180fa80..e6047f0 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 f45d904..6a8ceff 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 |