Skip to content

Commit 6150da1

Browse files
authored
Update puppeteer.ts
1 parent cb3813b commit 6150da1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

api/_lib/puppeteer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ export async function getScreenshot(url, width, height) {
1919
const page = await getPage();
2020
await page.setViewport({ width: Number(width) || 1280, height: Number(height) || 720, deviceScaleFactor: 2 });
2121
await page.goto(url {
22-
waitUntil: 'domcontentloaded',
22+
waitUntil: 'networkidle0',
2323
});
24-
await new Promise(r => setTimeout(r, 5000));
2524
const file = await page.screenshot();
2625
return file;
2726
}

0 commit comments

Comments
 (0)