From 12a81855a656c8dd8383e7461344649dae7bb4e4 Mon Sep 17 00:00:00 2001 From: snowtafir Date: Mon, 12 Aug 2024 23:21:24 +0800 Subject: [PATCH] optimize screenshot waitUntil --- utils/puppeteer.render.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/puppeteer.render.ts b/utils/puppeteer.render.ts index 4e56342..433c671 100644 --- a/utils/puppeteer.render.ts +++ b/utils/puppeteer.render.ts @@ -60,7 +60,7 @@ export class YukiPuppeteerRender extends Puppeteer { await page.setExtraHTTPHeaders(Options.header); } - await page.goto(`file://${htmlPath}`, { timeout: Options?.timeout ?? 120000, waitUntil: ["load", "networkidle2"] }); + await page.goto(`file://${htmlPath}`, { timeout: Options?.timeout ?? 120000, waitUntil: ["load", "networkidle0"] }); const body = await page.$(Options?.tab ?? 'body') if (!body) return false