Merge pull request #16612 from erm1116/fix-contentscript-updateEmbedElement
Fix reading property of null object in chrome extension's updateEmbedElement function
This commit is contained in:
commit
73b6ee5325
@ -132,8 +132,12 @@ function updateEmbedElement(elem) {
|
|||||||
}
|
}
|
||||||
elem.type = "text/html";
|
elem.type = "text/html";
|
||||||
elem.src = getEmbeddedViewerURL(elem.src);
|
elem.src = getEmbeddedViewerURL(elem.src);
|
||||||
|
|
||||||
if (parentNode) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user