Files
portal/app/scripts/_shot.cjs
T

10 lines
384 B
JavaScript
Raw Normal View History

const { chromium } = require('playwright');
const { pathToFileURL } = require('url');
(async () => {
const b = await chromium.launch({headless:true});
const p = await b.newPage({viewport:{width:1240,height:900}});
await p.goto(pathToFileURL(process.argv[2]).href, {waitUntil:'networkidle'});
await p.screenshot({path:process.argv[3], fullPage:true});
await b.close();
})();