diff --git a/src/drivers/webextension/js/popup.js b/src/drivers/webextension/js/popup.js index ef096ee69..01d35d3ee 100644 --- a/src/drivers/webextension/js/popup.js +++ b/src/drivers/webextension/js/popup.js @@ -201,6 +201,34 @@ function parseEmail(fullEmail) { return { email, name, title } } +function getTechnologySpend(technologies) { + const totals = technologies.reduce( + (totals, { pricing }) => { + pricing.forEach((price) => totals[price]++) + + return totals + }, + { low: 0, poa: 0, mid: 0, high: 0 } + ) + + totals.mid += Math.floor(totals.low / 3) + totals.high += Math.floor(totals.poa / 2) + totals.high += Math.floor(totals.mid / 3) + totals.xhigh = Math.floor(totals.high / 3) + + const spend = totals.xhigh + ? 'Very high' + : totals.high + ? 'High' + : totals.mid + ? 'Medium' + : totals.low + ? 'Low' + : 'Very low' + + return spend +} + const Popup = { /** * Initialise popup @@ -697,6 +725,14 @@ const Popup = { const { attributes, creditsRemaining, crawl } = data + if (Popup.cache.detections.length) { + attributes.signals = attributes.signals || [] + + attributes.signals.technologySpend = getTechnologySpend( + Popup.cache.detections + ) + } + el.creditsRemaining.textContent = parseInt( creditsRemaining || 0, 10 @@ -766,11 +802,20 @@ const Popup = { a.href = value.to a.textContent = value.text - if (['email', 'verifiedEmail', 'safeEmail'].includes(key)) { + if (key === 'keywords') { + a.style = 'padding-right: .3rem;' + + const space = document.createTextNode(' ') + + td.append(a, space) + } else if ( + ['email', 'verifiedEmail', 'safeEmail'].includes(key) + ) { const { email, name, title } = parseEmail(value.text) a.textContent = email + const div = document.createElement('div') const elName = document.createElement('span') const elTitle = document.createElement('span') const elBreak1 = document.createElement('br') @@ -781,17 +826,19 @@ const Popup = { elTitle.className = 'light-text' - td.appendChild(a) + div.append(a) - if (name) { - td.appendChild(elBreak1) - td.appendChild(elName) + if (name && name !== email) { + div.appendChild(elBreak1) + div.appendChild(elName) if (title) { - td.appendChild(elBreak2) - td.appendChild(elTitle) + div.appendChild(elBreak2) + div.appendChild(elTitle) } } + + td.append(div) } else { div.appendChild(a) td.appendChild(div) diff --git a/src/technologies/d.json b/src/technologies/d.json index 940e7ba2e..90ca52195 100644 --- a/src/technologies/d.json +++ b/src/technologies/d.json @@ -1127,7 +1127,8 @@ "driftt": "" }, "pricing": [ - "poa" + "poa", + "mid" ], "saas": true, "website": "https://www.drift.com/" @@ -1338,4 +1339,4 @@ "scriptSrc": "deepMiner\\.js", "website": "https://github.com/deepwn/deepMiner" } -} \ No newline at end of file +} diff --git a/src/technologies/h.json b/src/technologies/h.json index d1a4ee69c..e203d2982 100644 --- a/src/technologies/h.json +++ b/src/technologies/h.json @@ -817,6 +817,8 @@ "_hsq": "", "hubspot": "" }, + "pricing": ["recurring", "high"], + "saas": true, "website": "https://www.hubspot.com" }, "HubSpot Analytics": { @@ -1122,4 +1124,4 @@ "scriptSrc": "merchant\\.cdn\\.hoolah\\.co/", "website": "https://www.hoolah.co" } -} \ No newline at end of file +} diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 6f1f861c2..65bbae6c0 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -140,7 +140,7 @@ const Wappalyzer = { .sort((a, b) => (priority(a) > priority(b) ? 1 : -1)) .map( ({ - technology: { name, slug, categories, icon, website, cpe }, + technology: { name, slug, categories, icon, website, pricing, cpe }, confidence, version, lastUrl, @@ -152,6 +152,7 @@ const Wappalyzer = { version, icon, website, + pricing, cpe, lastUrl, }) @@ -340,6 +341,7 @@ const Wappalyzer = { requiresCategory, icon, website, + pricing, cpe, } = data[name] @@ -390,6 +392,7 @@ const Wappalyzer = { })), icon: icon || 'default.svg', website: website || null, + pricing: pricing || [], cpe: cpe || null, })