brenden / node-webshot

Easy website screenshots in Node.js
2.12k stars 286 forks source link

Images not finishing loading #128

Open ColemanGariety opened 8 years ago

ColemanGariety commented 8 years ago

The screenshot is generated before all the images on the page have finished downloading.

sirisian commented 8 years ago

I'm noticing this also. weather.com is a good example. You can wait even 10 seconds and the images won't be loaded. It's like the resources are timing out.

digitalnature commented 8 years ago

Same problem here, regardless how much renderDelay I add. Tried with phantomjs 1.9.0 and 2.1. But weirdly they are displayed if I test with google.com ...

ColemanGariety commented 8 years ago

Any update on this one? serious bug.

digitalnature commented 8 years ago

After more research I've found out that in my case it happened because of a javascript error on the client page. But the thing is that phantomjs doesn't report it, so it's very hard to debug. Actually I don't even know what the error was because it doesn't show up in a regular browser, I had to remove parts of the client side code until it started working.

Then I switched to electron + Xvfb (for "headless") because phantomjs wasn't generating accurate screenshots anyway, and I've found out the same thing happens there (hidden errors). But they can be debugged if you run your app in the Windows GUI for example, and enable the inspector. Electron has a "node integration" option for the client side and after disabling it everything was ok. This option brings up some conflicts if the site uses jQuery

ColemanGariety commented 8 years ago

@digitalnature I switched to screenshot-stream and that seems to work pretty well. just pushed that update this morning. we'll see how it goes.