diff --git a/src/drivers/webextension/js/driver.js b/src/drivers/webextension/js/driver.js index 84713e98b..cb418f4b3 100644 --- a/src/drivers/webextension/js/driver.js +++ b/src/drivers/webextension/js/driver.js @@ -275,7 +275,9 @@ const Driver = { }) // Remove duplicates - cache.detections = cache.detections.concat(detections) + cache.detections = cache.detections + .concat(detections) + .filter(({ technology }) => technology) cache.detections.filter( ({ technology: { name }, pattern: { regex } }, index) => @@ -309,20 +311,22 @@ const Driver = { ...cache, [hostname]: { ...Driver.cache.hostnames[hostname], - detections: Driver.cache.hostnames[hostname].detections.map( - ({ - technology: { name: technology }, - pattern: { regex, confidence }, - version - }) => ({ - technology, - pattern: { - regex: regex.source, - confidence - }, - version - }) - ) + detections: Driver.cache.hostnames[hostname].detections + .filter(({ technology }) => technology) + .map( + ({ + technology: { name: technology }, + pattern: { regex, confidence }, + version + }) => ({ + technology, + pattern: { + regex: regex.source, + confidence + }, + version + }) + ) } }), {} diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 250728995..d00fc8e1d 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -34,17 +34,19 @@ const Wappalyzer = { let version = '' let confidence = 0 - detections.forEach( - ({ technology: { name }, pattern, version: _version = '' }) => { - if (name === technology.name) { - confidence = Math.min(100, confidence + pattern.confidence) - version = - _version.length > version.length && _version.length <= 10 - ? _version - : version + detections + .filter(({ technology }) => technology) + .forEach( + ({ technology: { name }, pattern, version: _version = '' }) => { + if (name === technology.name) { + confidence = Math.min(100, confidence + pattern.confidence) + version = + _version.length > version.length && _version.length <= 10 + ? _version + : version + } } - } - ) + ) resolved.push({ technology, confidence, version }) }