Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda