html2canvas
html2canvas copied to clipboard
IFrames not working anymore
Looks like cloning iframes is not implemented in the latest?
Need to investigate better. The issue is related to iframes with an onload handler.
Nope, iframes don't work anymore. I have been trying to follow the code but for now will revert to alpha 1.
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.
Any solution on capturing iframe screenshot?
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
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
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?