Skip to content

Commit

Permalink
fix(print-pdf): wait untill all resources are loaded (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
moleus authored Nov 11, 2023
1 parent a302b13 commit 8406b7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default async (initialUrl, print, printSize) => {
const pdfOptions = { path: pdfFilename, printBackground: true };
Object.assign(pdfOptions, getPageOptions(printSize));

await page.goto(`${initialUrl}?print-pdf`, { waitUntil: 'load' });
await page.goto(`${initialUrl}?print-pdf`, { waitUntil: 'networkidle0' });
await page.pdf(pdfOptions);
await browser.close();
} catch (err) {
Expand Down

0 comments on commit 8406b7a

Please sign in to comment.