mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
try/catch createShadowRoot in contentscripts
This commit is contained in:
parent
1b56636be4
commit
b0072eab57
@ -470,7 +470,12 @@ var uBlockCollapser = (function() {
|
||||
if ( shadow !== null && shadow.className === sessionId ) {
|
||||
continue;
|
||||
}
|
||||
shadow = elem.createShadowRoot();
|
||||
// not all nodes can be shadowed
|
||||
try {
|
||||
shadow = elem.createShadowRoot();
|
||||
} catch (ex) {
|
||||
continue;
|
||||
}
|
||||
shadow.className = sessionId;
|
||||
}
|
||||
};
|
||||
|
@ -181,7 +181,12 @@ var hideElements = function(selectors) {
|
||||
if ( shadow !== null && shadow.className === sessionId ) {
|
||||
continue;
|
||||
}
|
||||
shadow = elem.createShadowRoot();
|
||||
// not all nodes can be shadowed
|
||||
try {
|
||||
shadow = elem.createShadowRoot();
|
||||
} catch (ex) {
|
||||
continue;
|
||||
}
|
||||
shadow.className = sessionId;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user