jasonday / printThis

jQuery printing plugin; print specific elements on a page

Home Page:https://jasonday.github.io/printThis/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Images do not load under Chrome when internet is slow

optimal-IT opened this issue · comments

While the pictures are visible in the website, the print preview leaves them out when the network connection is slow.
This happens only under Chromium-based browsers (no issue with Firefox and IE)

If you go to the demo website: https://jasonday.github.io/printThis/#demos
Change browser settings in DevTools > Network > set speed from Online to Slow 3G
Press 'PRINT CONTAINER' or 'PRINT KITTENS' buttons
The images have disappeared from the preview.

In the DevTools network tab when recording network log, it is also visible that the pictures are not fully loaded.

Having the same issue. Is there any update regarding this?

The issue is related to timing. You can increase the printDelay if you're printing with a lot of images, long form content, etc. to counteract. I'm working on a version where timing won't be an issue, but I don't have an ETA.

Just a guess, would it be possible to print the images without reloading them?
I don't have a detailed insight to jquery, but I wonder why the images need to be reloaded even though they are already visible in the page onbefore.

@patrickhrastnik - it's because of how printThis works. It creates an iframe, writes content to that iframe, and then prints the iframe. Those images have to load when being written to the new iframe.

for now I use printDelay, I count the number of images that are showing then multiply it.

printDelay: totalImages*500,