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

177
Visualizações
html2canvas works in firefox but not in chrome

I am capturing the screenshot of the Scorm content present inside the iframe, I am getting screenshot in the firefox but not in chrome, it seems like issue is with images path/url while rendering into the canvas.
I have compared the result of logging: true from both browser.
And I found that images path in the chrome is changed that's why it is not working in chrome.
How can i solve this? help me........

var iframeEle = document.querySelector("iframe").contentWindow.document.body;//working

console.log(iframeEle);

// $('#saveReport').on('click', function(){
    html2canvas(iframeEle, {
        //background: '#fff',
       // height: window.innerHeight,
        //windowHeight: window.innerHeight,
        logging: true,
       
        onrendered: function(canvas){
            // before_imgData = canvas.toDataURL('image/png');
            before_imgData = canvas.toDataURL('image/jpeg');
        }
    });

Log for firefox browser :
when I checked path of images for rendering it is correct. enter image description here


Log for chrome browser :
in chrome the path for images is not right as it consist of current url of browser thats why is not capturing correctly.
I think it is issue of relative path for chrome and not for firefox.

enter image description here

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