blob: 4cf891110925a76367fbd299ccc97b1c64eb6813 [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: {
Marc Kupietzc7249f92023-10-10 07:16:50 +020016 width: 1920,
17 height: 1080,
Marc Kupietz02d582a2023-10-09 20:11:52 +020018 isLandscape: true,
Marc Kupietzc7249f92023-10-10 07:16:50 +020019 deviceScaleFactor: 0.5
Marc Kupietz02d582a2023-10-09 20:11:52 +020020 }
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})();