mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
code review
This commit is contained in:
parent
8e5ff6693b
commit
6ea3338f26
2 changed files with 11 additions and 9 deletions
|
@ -470,13 +470,14 @@ var uBlockCollapser = (function() {
|
|||
if ( shadow !== null && shadow.className === sessionId ) {
|
||||
continue;
|
||||
}
|
||||
// https://github.com/w3c/webcomponents/issues/102
|
||||
// not all nodes can be shadowed
|
||||
try {
|
||||
shadow = elem.createShadowRoot();
|
||||
shadow.className = sessionId;
|
||||
} 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 ) {
|
||||
continue;
|
||||
}
|
||||
// not all nodes can be shadowed
|
||||
try {
|
||||
shadow = elem.createShadowRoot();
|
||||
} catch (ex) {
|
||||
continue;
|
||||
}
|
||||
shadow.className = sessionId;
|
||||
// https://github.com/w3c/webcomponents/issues/102
|
||||
// not all nodes can be shadowed
|
||||
try {
|
||||
shadow = elem.createShadowRoot();
|
||||
shadow.className = sessionId;
|
||||
} catch (ex) {
|
||||
elem.style.setProperty('display', 'none', 'important');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue