1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00
This commit is contained in:
gorhill 2015-09-28 15:51:02 -04:00
parent 34b58178bc
commit cc17a77b0a

View File

@ -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');
}
}
};