我在限制中看到我们无法捕获 html 的 iframe。 但我想知道有没有办法以任何其他方式克服这个问题。
谢谢,阿维
看:
https://github.com/niklasvh/html2canvas/issues/376
http://html2canvas.hertzen.com/documentation.html
理论上,您可以捕获本地 iframe 的内容,但不能捕获嵌入了 iframe 的窗口。 添加并非易事,但想象一下该功能将在某个时候重新集成。
0.5 将支持渲染同源 iframe,例如:
https://github.com/niklasvh/html2canvas/blob/master/tests/cases/iframe.html
是否有任何跨源 iframe 捕获?
我们遇到了同样的问题,我们想从不同域捕获 iframe 内的图像。 我们尝试了子域,但它不起作用:( 所以任何跨源 iframe 捕获解决方案?
由于浏览器安全限制,跨源 iframe 是不可能的。 您将需要一个代理来将内容下载到同一来源。
最有用的评论
0.5 将支持渲染同源 iframe,例如:
https://github.com/niklasvh/html2canvas/blob/master/tests/cases/iframe.html