Skip to content

Commit

Permalink
Await network idle before generating PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
samkpower committed Jul 30, 2019
1 parent 9f5865a commit 863f2e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/renderers/chrome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ export class ChromeRenderer extends Renderer {
delete options.emulateMedia;
}

await page._chromePage.waitForNavigation({
waitUntil: 'networkidle',
networkIdleInflight: 0,
timeout: 0
});

buffer = await page._chromePage.pdf(options);
break;
default:
Expand Down

0 comments on commit 863f2e0

Please sign in to comment.