fix: use node.insertBefore for adding embed element

This commit is contained in:
erm1116 2023-06-27 20:50:25 +09:00
parent c4a61a7692
commit fcf38f6ae9

View File

@ -132,8 +132,12 @@ function updateEmbedElement(elem) {
}
elem.type = "text/html";
elem.src = getEmbeddedViewerURL(elem.src);
if (parentNode) {
nextSibling.before(elem);
// Suppress linter warning: insertBefore is preferable to
// nextSibling.before(elem) because nextSibling may be null.
// eslint-disable-next-line unicorn/prefer-modern-dom-apis
parentNode.insertBefore(elem, nextSibling);
}
}