check if orphaned in docRewriteObserver
This commit is contained in:
parent
3713c252a8
commit
3b433adb42
3
apply.js
3
apply.js
|
@ -246,6 +246,9 @@ function initDocRewriteObserver() {
|
||||||
}
|
}
|
||||||
// re-add styles if we detect documentElement being recreated
|
// re-add styles if we detect documentElement being recreated
|
||||||
const reinjectStyles = () => {
|
const reinjectStyles = () => {
|
||||||
|
if (!styleElements) {
|
||||||
|
return orphanCheck && orphanCheck();
|
||||||
|
}
|
||||||
ROOT = document.documentElement;
|
ROOT = document.documentElement;
|
||||||
for (const el of styleElements.values()) {
|
for (const el of styleElements.values()) {
|
||||||
addStyleElement(document.importNode(el, true));
|
addStyleElement(document.importNode(el, true));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user