From 83cd5673d822edbaed637143c195b14d89f0c6be Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Sat, 3 Jul 2021 16:03:26 +1000 Subject: [PATCH] Fix for cached detections issue, improve Square detection --- src/drivers/webextension/js/content.js | 11 ++++------- src/drivers/webextension/js/driver.js | 2 ++ src/technologies.json | 6 ++++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/drivers/webextension/js/content.js b/src/drivers/webextension/js/content.js index 605422089..f30257901 100644 --- a/src/drivers/webextension/js/content.js +++ b/src/drivers/webextension/js/content.js @@ -120,7 +120,6 @@ function getDom(technologies) { } const Content = { - href: location.href, cache: {}, language: '', @@ -237,7 +236,7 @@ const Content = { Content.cache = { html, css, scripts, meta } await Content.driver('onContentLoad', [ - Content.href, + location.href, Content.cache, Content.language, ]) @@ -325,7 +324,7 @@ const Content = { await Promise.all([ Content.onGetTechnologies(technologies, name), Content.driver('onContentLoad', [ - Content.href, + location.href, Content.cache, Content.language, name, @@ -341,14 +340,12 @@ const Content = { * @param {Array} technologies */ async onGetTechnologies(technologies = [], requires) { - const url = location.href.split('#')[0] - const js = await getJs(technologies) const dom = getDom(technologies) await Promise.all([ - Content.driver('analyzeJs', [url, js, requires]), - Content.driver('analyzeDom', [url, dom, requires]), + Content.driver('analyzeJs', [location.href, js, requires]), + Content.driver('analyzeDom', [location.href, dom, requires]), ]) }, } diff --git a/src/drivers/webextension/js/driver.js b/src/drivers/webextension/js/driver.js index ef02f1a8d..34c7f458e 100644 --- a/src/drivers/webextension/js/driver.js +++ b/src/drivers/webextension/js/driver.js @@ -485,6 +485,8 @@ const Driver = { incrementHits = false, analyzeRequires = true ) { + url = url.split('#')[0] + if (!url || !detections.length) { return } diff --git a/src/technologies.json b/src/technologies.json index 52d0435be..4f6e82ede 100644 --- a/src/technologies.json +++ b/src/technologies.json @@ -19409,8 +19409,10 @@ "icon": "Square.svg", "js": { "SqPaymentForm": "", - "Square.Analytics": "" + "Square.Analytics": "", + "__BOOTSTRAP_STATE__.storeInfo.square_application_id": "" }, + "xhr": "\\.squareup\\.com", "scripts": "js\\.squareup\\.com", "website": "https://squareup.com/" }, @@ -25188,4 +25190,4 @@ "website": "https://www.xt-commerce.com" } } -} \ No newline at end of file +}