Skip to content

Commit bf500f7

Browse files
authored
Update puppeteer.ts
1 parent 6962eab commit bf500f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

api/_lib/puppeteer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ async function getPage() {
1919
export async function getScreenshot(url, width, height) {
2020
const page = await getPage();
2121
await page.setViewport({ width: Number(width) || 1280, height: Number(height) || 720, deviceScaleFactor: 2 });
22-
await page.goto(url);
23-
await new Promise(r => setTimeout(r, 3000));
22+
await page.goto(url {
23+
waitUntil: 'domcontentloaded',
24+
});
2425
const file = await page.screenshot();
2526
return file;
2627
}

0 commit comments

Comments
 (0)