mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-10 09:24:49 +00:00
check if iframe content exists before replacing it
This commit is contained in:
parent
ab229d926e
commit
6b4268f5b0
2 changed files with 12 additions and 32 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue