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) {
|
if (el.parentNode !== document.documentElement) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
let i = 1;
|
let i = 0;
|
||||||
while (el && i < list.length) {
|
while (el) {
|
||||||
if (el.nextSibling === list[i].el) {
|
if (i < list.length && el === list[i].el) {
|
||||||
i++;
|
i++;
|
||||||
} else if (ORDERED_TAGS.has(el.localName)) {
|
} else if (ORDERED_TAGS.has(el.localName)) {
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
el = el.nextSibling;
|
el = el.nextSibling;
|
||||||
}
|
}
|
||||||
|
// some styles are not injected to the document
|
||||||
return i < list.length;
|
return i < list.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user