Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda