From 2a7aea96a4e030d6ac2b12e458da0cdeac9c557c Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Wed, 11 Aug 2021 07:30:19 +1000 Subject: [PATCH] Add WorldPay detection --- src/drivers/npm/driver.js | 42 ++++++++++--------- .../webextension/images/icons/WorldPay.svg | 3 ++ src/technologies.json | 19 +++++++-- 3 files changed, 40 insertions(+), 24 deletions(-) create mode 100644 src/drivers/webextension/images/icons/WorldPay.svg diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index 26feedd2b..10412f193 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -580,7 +580,7 @@ class Site { try { await this.promiseTimeout( - page.goto(url.href, { waitUntil: 'domcontentloaded' }), + page.goto(url.href), undefined, 'Timeout (navigation)' ) @@ -592,28 +592,30 @@ class Site { // page.on('console', (message) => this.log(message.text())) // Links - const links = await this.promiseTimeout( - ( - await this.promiseTimeout( - page.evaluateHandle(() => - Array.from(document.getElementsByTagName('a')).map( - ({ hash, hostname, href, pathname, protocol, rel }) => ({ - hash, - hostname, - href, - pathname, - protocol, - rel, - }) + const links = !this.options.recursive + ? [] + : await this.promiseTimeout( + ( + await this.promiseTimeout( + page.evaluateHandle(() => + Array.from(document.getElementsByTagName('a')).map( + ({ hash, hostname, href, pathname, protocol, rel }) => ({ + hash, + hostname, + href, + pathname, + protocol, + rel, + }) + ) + ), + { jsonValue: () => [] }, + 'Timeout (links)' ) - ), - { jsonValue: () => [] }, + ).jsonValue(), + [], 'Timeout (links)' ) - ).jsonValue(), - [], - 'Timeout (links)' - ) // CSS const css = await this.promiseTimeout( diff --git a/src/drivers/webextension/images/icons/WorldPay.svg b/src/drivers/webextension/images/icons/WorldPay.svg new file mode 100644 index 000000000..6e3470330 --- /dev/null +++ b/src/drivers/webextension/images/icons/WorldPay.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/technologies.json b/src/technologies.json index 8323a7620..3cd781004 100644 --- a/src/technologies.json +++ b/src/technologies.json @@ -3606,9 +3606,6 @@ "]* href=[^>]*?bootstrap(?:[^>]*?([0-9a-fA-F]{7,40}|[\\d]+(?:.[\\d]+(?:.[\\d]+)?)?)|)[^>]*?(?:\\.min)?\\.css\\;version:\\1" ], "icon": "Bootstrap.svg", - "implies": [ - "jQuery\\;confidence:50" - ], "js": { "bootstrap.Alert.VERSION": "^(.+)$\\;version:\\1", "jQuery.fn.tooltip.Constructor.VERSION": "^(.+)$\\;version:\\1" @@ -15814,6 +15811,7 @@ "paypalClientId": "", "paypalJs": "" }, + "xhr": "\\.paypal\\.com", "pricing": [ "payg" ], @@ -20906,6 +20904,19 @@ "icon": "Strikingly.png", "website": "https://strikingly.com" }, + "WorldPay": { + "cats": [ + 41 + ], + "description": "", + "icon": "WorldPay.svg", + "dom": "img[src*='secure.worldpay.com'], img[alt='Powered by WorldPay'], a[href*='worldpay.com'][target='_blank']", + "pricing": [ + "payg" + ], + "saas": true, + "website": "https://online.worldpay.com" + }, "Stripe": { "cats": [ 41 @@ -26699,4 +26710,4 @@ "website": "https://www.xt-commerce.com" } } -} \ No newline at end of file +}