content script may run before documentElement is present
This commit is contained in:
parent
e41dda1b68
commit
a6fdb49503
|
@ -202,6 +202,17 @@
|
||||||
requestStyles();
|
requestStyles();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!document.documentElement) {
|
||||||
|
new MutationObserver((mutations, observer) => {
|
||||||
|
if (document.documentElement) {
|
||||||
|
observer.disconnect();
|
||||||
|
applyStyles(styles);
|
||||||
|
}
|
||||||
|
}).observe(document, {childList: true});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ('disableAll' in styles) {
|
if ('disableAll' in styles) {
|
||||||
doDisableAll(styles.disableAll);
|
doDisableAll(styles.disableAll);
|
||||||
delete styles.disableAll;
|
delete styles.disableAll;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user