Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
Take screenshot with html2canvas and download it without cloning images

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!