无法使用 html2canvas 捕获 iframe 内存在的 scorm 内容
我正在尝试捕获 iframe 内存在的 SCORM 的屏幕截图,但它正在捕获 iframe 的内容,我正在使用 html2canvas 为此。 SCORM 的所有文件都存在于同一服务器上。
这是我的 scorm 的第一张幻灯片/页面。
1) 首先,我通过了 $('iframe')
和 var iframe = document.querySelector("iframe").contentWindow.document.body; 到
html2canvas
但它工作得不好。
输出如下 Img
2) 然后我将 e.target.parentNode
传递给 html2canvas
,以便它捕获当前元素的父元素.
输出如下:
这是我的代码:
html2canvas($('iframe'), {
logging: true,
onrendered: function(canvas){
before_imgData = canvas.toDataURL('image/png');
// console.log(before_imgData);
}
});
但是我想要所有屏幕的屏幕截图,我怎样才能实现这一点,任何帮助将不胜感激。
I am trying to capture the screenshot of the SCORM present inside the iframe but it is capturing content of the iframe, I am using html2canvas for that. All the files of SCORM are present on same server.
This is first slide/page of my scorm.
1) Firstly I have passed $('iframe')
and var iframe = document.querySelector("iframe").contentWindow.document.body;
to html2canvas
but it is not working well.
Output of this is following Img
2) Then I passed e.target.parentNode
to html2canvas
so it capturing current element's parent.
Output this is following :
Here is my code :
html2canvas($('iframe'), {
logging: true,
onrendered: function(canvas){
before_imgData = canvas.toDataURL('image/png');
// console.log(before_imgData);
}
});
But I want screenshot of all the screen how can I achieve that, any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论