We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6962eab commit bf500f7Copy full SHA for bf500f7
api/_lib/puppeteer.ts
@@ -19,8 +19,9 @@ async function getPage() {
19
export async function getScreenshot(url, width, height) {
20
const page = await getPage();
21
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));
+ await page.goto(url {
+ waitUntil: 'domcontentloaded',
24
+ });
25
const file = await page.screenshot();
26
return file;
27
}
0 commit comments