From 8b1a693f9f8492f9a9e49aef6b3a64ace9e50e9d Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 26 Jan 2020 12:02:24 +0100 Subject: Import into git --- magiccapture/index.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 magiccapture/index.js (limited to 'magiccapture/index.js') diff --git a/magiccapture/index.js b/magiccapture/index.js new file mode 100644 index 0000000..0db29a6 --- /dev/null +++ b/magiccapture/index.js @@ -0,0 +1,21 @@ +const path = require('path'); +const puppeteer = require('puppeteer-core'); + +async function main() { + const browser = await puppeteer.launch({ + executablePath: 'google-chrome-stable', + args: ['--no-sandbox'], + }) + const page = await browser.newPage(); + await page.setViewport({ + width: 600, + height: 800 + }); + await page.goto(`http://localhost:8080`, { waitUntil: 'networkidle0' }); + await page.waitFor(2000); + await page.screenshot({path: 'screenshot/color.png'}); + + await browser.close(); +} + +main().then(console.log).catch(console.error) -- cgit v1.3.1