From 31d8574f295b676e52ad31dd45bf6618d14d6615 Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Thu, 2 Sep 2021 11:03:14 +1000 Subject: [PATCH] Fix for too many technologies detected --- src/drivers/npm/driver.js | 9 +++++++-- src/drivers/webextension/js/inject.js | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index cbf828d52..de45d7727 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -67,11 +67,16 @@ function getJs(page, technologies = Wappalyzer.technologies) { const value = chain .split('.') .reduce( - (value, method) => (value ? value[method] : undefined), + (value, method) => + value && + value instanceof Object && + Object.prototype.hasOwnProperty.call(value, method) + ? value[method] + : '__UNDEFINED__', window ) - if (typeof value !== 'undefined') { + if (value !== '__UNDEFINED__') { technologies.push({ name, chain, diff --git a/src/drivers/webextension/js/inject.js b/src/drivers/webextension/js/inject.js index 63d81ec45..c554dccfb 100644 --- a/src/drivers/webextension/js/inject.js +++ b/src/drivers/webextension/js/inject.js @@ -14,7 +14,7 @@ postMessage({ wappalyzer: { js: technologies.reduce((technologies, { name, chains }) => { - chains.forEach((chain) => { + chains.forEach((chain, index) => { const value = chain .split('.') .reduce( @@ -23,11 +23,11 @@ value instanceof Object && Object.prototype.hasOwnProperty.call(value, method) ? value[method] - : undefined, + : '__UNDEFINED__', window ) - if (value !== undefined) { + if (value !== '__UNDEFINED__') { technologies.push({ name, chain,