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

176
Views
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
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!