mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: iframe load to ensure images are loaded
This commit is contained in:
@@ -472,11 +472,8 @@ const iframeLoader = (iframe: HTMLIFrameElement): Promise<HTMLIFrameElement> =>
|
|||||||
|
|
||||||
const documentClone = cloneWindow.document;
|
const documentClone = cloneWindow.document;
|
||||||
|
|
||||||
cloneWindow.onload =
|
cloneWindow.onload = iframe.onload = () => {
|
||||||
iframe.onload =
|
cloneWindow.onload = iframe.onload = null;
|
||||||
documentClone.onreadystatechange =
|
|
||||||
() => {
|
|
||||||
cloneWindow.onload = iframe.onload = documentClone.onreadystatechange = null;
|
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
|
if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
|
|||||||
Reference in New Issue
Block a user