mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-14 23:12:28 +02:00
code review
This commit is contained in:
parent
8e5ff6693b
commit
6ea3338f26
@ -470,13 +470,14 @@ var uBlockCollapser = (function() {
|
|||||||
if ( shadow !== null && shadow.className === sessionId ) {
|
if ( shadow !== null && shadow.className === sessionId ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// https://github.com/w3c/webcomponents/issues/102
|
||||||
// not all nodes can be shadowed
|
// not all nodes can be shadowed
|
||||||
try {
|
try {
|
||||||
shadow = elem.createShadowRoot();
|
shadow = elem.createShadowRoot();
|
||||||
|
shadow.className = sessionId;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
continue;
|
elem.style.setProperty('display', 'none', 'important');
|
||||||
}
|
}
|
||||||
shadow.className = sessionId;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -181,13 +181,14 @@ var hideElements = function(selectors) {
|
|||||||
if ( shadow !== null && shadow.className === sessionId ) {
|
if ( shadow !== null && shadow.className === sessionId ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// not all nodes can be shadowed
|
// https://github.com/w3c/webcomponents/issues/102
|
||||||
try {
|
// not all nodes can be shadowed
|
||||||
shadow = elem.createShadowRoot();
|
try {
|
||||||
} catch (ex) {
|
shadow = elem.createShadowRoot();
|
||||||
continue;
|
shadow.className = sessionId;
|
||||||
}
|
} catch (ex) {
|
||||||
shadow.className = sessionId;
|
elem.style.setProperty('display', 'none', 'important');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user