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 763c526 commit 5c9d46bCopy full SHA for 5c9d46b
api/_lib/puppeteer.ts
@@ -17,8 +17,9 @@ async function getPage() {
17
18
export async function getScreenshot(url, width, height) {
19
const page = await getPage();
20
+ await page.setViewport({ width: Number(width) || 1280, height: Number(height) || 720, deviceScaleFactor: 2 });
21
await page.goto(url);
- await page.setViewport({ width: Number(width) || 1280, height: Number(height) || 720, deviceScaleFactor: 2 });
22
+ await new Promise(r => setTimeout(r, 3000));
23
const file = await page.screenshot();
24
return file;
25
}
0 commit comments