Search code examples
javascripturlscreenshothtml2canvas

Take a screenshot of a external website in html2canvas javascript


I am using javascript html2canvas for taking a screenshot of web page. here is a code:

html2canvas(document.body, {
 onrendered: function(canvas) {
 document.body.appendChild(canvas);
 }
});

how can I use url. Like if I want to take a screenshot of google. Then what did I do for this..


Solution

  • You can't.

    If it was possible then you could, for example, have your website take a screen shot of a page on the user's company's intranet, or their online banking, or their web mail.

    This would be a tremendous security hole and is therefore not allowed.