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

175
Vistas
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 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