check if iframe content exists before replacing it

This commit is contained in:
Alex Adam 2020-06-18 16:39:44 +03:00
parent ab229d926e
commit 6b4268f5b0
2 changed files with 12 additions and 32 deletions

View file

@ -122,6 +122,9 @@ function extractIFrames() {
let changeIFrames = []
let newDivs = []
for (let iFrame of allIframes) {
if (!iFrame.contentDocument || !iFrame.contentDocument.body) {
continue
}
let bodyContent = iFrame.contentDocument.body.innerHTML
let bbox = iFrame.getBoundingClientRect()
let newDiv = document.createElement('div')