Fix: also check elements after the last userstyle
This commit is contained in:
parent
f761aadb1a
commit
788085d376
|
@ -38,15 +38,16 @@ function createStyleInjector({compare, setStyleContent, onUpdate}) {
|
|||
if (el.parentNode !== document.documentElement) {
|
||||
return true;
|
||||
}
|
||||
let i = 1;
|
||||
while (el && i < list.length) {
|
||||
if (el.nextSibling === list[i].el) {
|
||||
let i = 0;
|
||||
while (el) {
|
||||
if (i < list.length && el === list[i].el) {
|
||||
i++;
|
||||
} else if (ORDERED_TAGS.has(el.localName)) {
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
el = el.nextSibling;
|
||||
}
|
||||
// some styles are not injected to the document
|
||||
return i < list.length;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user