html2canvas icon indicating copy to clipboard operation
html2canvas copied to clipboard

IFrames not working anymore

Open lucapivato opened this issue 5 years ago • 7 comments

Looks like cloning iframes is not implemented in the latest?

lucapivato avatar Aug 26 '20 17:08 lucapivato

Need to investigate better. The issue is related to iframes with an onload handler.

lucapivato avatar Aug 26 '20 18:08 lucapivato

Nope, iframes don't work anymore. I have been trying to follow the code but for now will revert to alpha 1.

lucapivato avatar Aug 26 '20 18:08 lucapivato

In v1.0.0-rc.1 still worked. After that the code to handle it has been commented out in changes. I think that the author knows more about that.

abramobagnara avatar Mar 25 '21 09:03 abramobagnara

Any solution on capturing iframe screenshot?

KirDontsov avatar Apr 13 '21 09:04 KirDontsov

Check the element that passed to the html2canvas. That might be the reason. I solved this problem by catching the document of iframe correctly. const element = document.getElementById( 'my-iframe' ).contentWindow.document.getElementById('inner-content'); html2canvas(element, { useCORS: true, scrollY: document.body.scrollTop }).then(canvas => { const img = canvas.toDataURL(); }); FYR: https://stackoverflow.com/questions/3999101/get-iframes-document-from-javascript-in-main-document

callmeerika avatar Jun 02 '21 06:06 callmeerika

2023, the latest version is not working...I have a page that includes iframes and html2canvas will output an empty element. It's because html2canvas dosen't render iframe's content

gxy5202 avatar Jul 21 '23 02:07 gxy5202

problem is not creating individual iframe to canvas problem is getting ALL the content along with the iframes.

how to capture the body and have the iframes replaced with images?

jgarcianewemage avatar Jun 05 '24 22:06 jgarcianewemage