From f353a5e6e5bad0a5ac5e4c577c4d18a4e0fcda93 Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Sat, 11 Feb 2023 09:44:58 +1100 Subject: [PATCH] Add --defer option to defer scanning the page after loading --- src/drivers/npm/README.md | 1 + src/drivers/npm/cli.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/drivers/npm/README.md b/src/drivers/npm/README.md index 5f4181513..c8b739200 100644 --- a/src/drivers/npm/README.md +++ b/src/drivers/npm/README.md @@ -41,6 +41,7 @@ wappalyzer [options] -e, --extended Output additional information --local-storage=... JSON object to use as local storage --session-storage=... JSON object to use as session storage +--defer=ms Defer scan for ms milliseconds after page load ``` diff --git a/src/drivers/npm/cli.js b/src/drivers/npm/cli.js index 357fbf975..5241ec698 100755 --- a/src/drivers/npm/cli.js +++ b/src/drivers/npm/cli.js @@ -92,6 +92,7 @@ Options: -e, --extended Output additional information --local-storage=... JSON object to use as local storage --session-storage=... JSON object to use as session storage + --defer=ms Defer scan for ms milliseconds after page load `) process.exit(options.help ? 0 : 1) } @@ -154,6 +155,10 @@ for (const type of Object.keys(storage)) { const site = await wappalyzer.open(url, headers, storage) + await new Promise((resolve) => + setTimeout(resolve, parseInt(options.defer || 0, 10)) + ) + const results = await site.analyze() process.stdout.write(