I'm using html2canvas to capture a screenshot of a site on different devices and send them to a storage via a XMLHTTPRequest.
Especially on sites with a lot of content the resulting screenshots tend to be very high and large, although most of the information in the screenshot is not relevant to what I need to caputure.
I've been trying to temper with the canvas element to have it only contain what I am currently seeing in the browser instead of capturing the whole body of the page, but without success.
Is it possible to tweak html2canvas in a way that allows to only capture the current window instead of the whole body?
Currently used code is:
html2canvas(document.body).then(function(canvas) {
var img = canvas.toDataURL("image/png");
ajax_post(img);
});