From cd5fe45fe47a6c7c0ae2455a3d1569159b5d2f7a Mon Sep 17 00:00:00 2001 From: Malo Date: Mon, 29 May 2023 22:08:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20puppeteer=20warning=20(#25?= =?UTF-8?q?4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/DownloadController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/DownloadController.ts b/src/controllers/DownloadController.ts index e7888b72..9cdb6fac 100644 --- a/src/controllers/DownloadController.ts +++ b/src/controllers/DownloadController.ts @@ -178,7 +178,7 @@ export class DownloadController { try { const browser = await puppeteer.launch({ - headless: true, + headless: 'new', executablePath: '/usr/bin/chromium-browser', args: [ '--no-sandbox', @@ -195,7 +195,7 @@ export class DownloadController { }) } - await page.goto(url) + await page.goto(url, { waitUntil: 'networkidle0' }) const pdf = await page.pdf({ path: filePath, format: 'a4', printBackground: true }) await browser.close()