I use html2canvas to capture a screenshot on different devices and send them to storage via XMLHTTPRequest.
Especially on sites with high content, the resulting screenshots tend to be very large and large, although most of the information in the screenshot is not related to what I need to create a caputure.
I am trying to tolerate the canvas element so that it contains only what I now see in the browser, instead of capturing the entire text of the page, but to no avail.
Is it possible to configure html2canvas so that you can only capture the current window instead of the whole body?
Used code:
html2canvas(document.body).then(function(canvas) {
var img = canvas.toDataURL("image/png");
ajax_post(img);
});
source
share