summaryrefslogtreecommitdiff
path: root/snappy.js
diff options
context:
space:
mode:
authorrain <rain@puddle.local>2023-07-31 10:08:28 -0500
committerrain <rain@puddle.local>2023-07-31 10:08:28 -0500
commitfe0b515f37fde090c870a5c01797dadf8f14ac5d (patch)
tree6c359dd6759a6ab7b1840b3871c2a0126217e292 /snappy.js
parentb66c59b4b1dc200e12365265bd2b01e77d4dbc92 (diff)
Added extra delay cmdline arg for those weird slow websites
Diffstat (limited to 'snappy.js')
-rwxr-xr-xsnappy.js3
1 files changed, 3 insertions, 0 deletions
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", "<File with a list of websites>"],
["-w", "<Windows Size, Default:1280x720>"],
["-v", "<Check if screenshots are blank and output to...>"],
+ ["-t", "Add additional delay to screenshots (Seconds)"],
["-p", "<SOCKS5 Proxy Port>"]
];
@@ -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;