Closed sandeepnagra closed 6 years ago
@sandeepnagra Were you able to determine what the error was with Firefox and/or IE? I assume its something with the implementation of html2canvas.js ? I could theoretically let Firefox use version 0.5.x and Chrome use v 1.x until there is a stable cross-platform...
@samnissen - I have reported a bug with html2canvas project for this issue - https://github.com/niklasvh/html2canvas/issues/1476
Once they fix it for Firefox and IE, I will raise a PR for the fix I have in my fork.
@sandeepnagra I implemented code to switch between the latest htmlcanvas with onrendered and and the current version with the current JavaScript, and the screenshots I took of Mass Mutual's site are identical. Do you have any other sites that exhibit this behavior that I can test this against?
@samnissen - when you say identical, do you mean you still don't see images included? If yes, then look at my PR and update the javascript to what I have in my PR and it should work.
Sorry, I mean that the following all look effectively the same:
base64_canvas
screenshot of massmutual.com using the current / old method with Firefoxbase64_canvas
screenshot of massmutual.com using the current / old method with Chromebase64_canvas
screenshot of massmutual.com using the new / proposed method with ChromeI cannot replicate the image you showed once (I can't remember where) of mass Mutual's website with many of the images looking wrong or missing.
Even I can't find where I shared the screenshots that didn't had images. We had multiple discussions across different tickets. I also raised a PR in #27 and we had discussion in #26 as well. I also reported a bug with html2canvas for the Firefox issue. I remember updating html2canvas version because it was not capturing any image on the webpage.
Well, many thanks for looking into this anyway. Let me know if you can re-reproduce the bug conditions, and I'll reopen this straight away.
Hi @samnissen,
I found the scenario for which this issue is reproducible. Try taking a base64_canvas screenshot of this site - https://advisors.massmutual.com/
It will generate a bad/corrupt PNG. Now try the same with the changes I have made in my PR - https://github.com/sandeepnagra/watir-screenshot-stitch and it will render a proper PNG.
Thanks, I'll reopen this now.
Fixed by #36
I have a fix for it but it works in all browsers except Firefox and IE.
Chrome, Edge, Safari works like a charm. The fix is in my fork for your review @samnissen - https://github.com/sandeepnagra/watir-screenshot-stitch/blob/master/lib/watir-screenshot-stitch.rb
All I did is upgrade the html2canvas.js file and replace a deprecated option onrendered with new .then option.
I am trying to find a fix for Firefox & IE as well but I haven't had any good luck with it yet. Will keep searching and if I find a fix for those two browsers, I will add it and then raise a PR.