From fe0b515f37fde090c870a5c01797dadf8f14ac5d Mon Sep 17 00:00:00 2001 From: rain Date: Mon, 31 Jul 2023 10:08:28 -0500 Subject: Added extra delay cmdline arg for those weird slow websites --- snappy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snappy.js b/snappy.js index a9a136b..59ced51 100755 --- a/snappy.js +++ b/snappy.js @@ -25,6 +25,7 @@ if(argv.h){ ["-i", ""], ["-w", ""], ["-v", ""], + ["-t", "Add additional delay to screenshots (Seconds)"], ["-p", ""] ]; @@ -134,6 +135,8 @@ async function run() { //await page.goto(site, { waitUntil: 'domcontentloaded' }); //await timeout(5000); //This can be used to REALLY slow down and wait for pages to load await page.goto(site, { waitUntil: 'networkidle2' }).then(async () => { + let userTimeout = parseInt(argv.t); + await timeout(isNaN(userTimeout)?0:userTimeout*1000); await page.screenshot({path: imageName}).then(async () => { if(!argv.v) return; -- cgit v1.2.3