I have this task
https://jsfiddle.net/w76hvrab/
take a screenshot of a page with hundred images from different external domains.
I'm using html2canvas to take the screenshot
function screenshot(){
html2canvas(document.body,{allowTaint: true,
useCORS: true,
width: window.innerWidth,
height: window.innerHeight,
scrollX: window.pageXOffset,
scrollY: window.pageYOffset,
x: window.pageXOffset,
y: window.pageYOffset,
}).then(function(canvas){
document.getElementsByClassName("modal-body")[0].innerHTML = "";
document.getElementsByClassName("modal-body")[0].appendChild(canvas);});
}
and it shows the result on a popup.
I cannot download the image generate because, if I use .toDataUrl(), or .toBlob(), it gives me back error of crossOrigin with SecurityError.
I understand how html2canvas works and why it needs, in this case, allowTaint: false, duplicating images, but I can't allow to duplicate all the files every time!
Is there a way to download the image in popup, preventing to clone the images?
Please, could anyone help me?