PejmanNik/puppeteer-report

Lazy images not loading beforprint

swamidass opened this issue · 1 comments

This seems to be an issue with puppeteer, which needs to know that each image is in view before loading them. Is there an option to fix this?

This code might be a drop in fix...


// Scroll one viewport at a time, pausing to let content load
  const viewportHeight = page.viewport().height;
  let viewportIncr = 0;
  while (viewportIncr + viewportHeight < height) {
    await page.evaluate(_viewportHeight => {
      window.scrollBy(0, _viewportHeight);
    }, viewportHeight);
    await wait(20);
    viewportIncr = viewportIncr + viewportHeight;
  }

https://gist.github.com/schnerd/b550b7c05d4a57d8374082aaae714881

It is not related to this library. It seems your doing it right based on this sorry but I need to close this issue.