blob: 996355970c6d4e76534e6622a54956b1440ae0cb [file] [log] [blame]
Marc Kupietz02d582a2023-10-09 20:11:52 +02001#!/usr/bin/env node
2
3const puppeteer = require('puppeteer');
4
5function delay(time) {
6 return new Promise(function (resolve) {
7 setTimeout(resolve, time)
8 });
9}
10
11(async () => {
12 const browser = await puppeteer.launch({
13 headless: "new",
14 args: ['--no-sandbox'],
15 defaultViewport: {
16 width: 1024,
17 height: 600,
18 isLandscape: true,
19 deviceScaleFactor: 1
20 }
21 });
22
23 const page = await browser.newPage();
24
25 for (var i = 2; i < process.argv.length; i += 2) {
26 await page.goto(process.argv[i], { waitUntil: 'networkidle2' });
27 await delay(1000);
28 await page.screenshot({ path: process.argv[i+1] });
29 }
30
31 await browser.close();
32})();