Fix for cached detections issue, improve Square detection

main
Elbert Alias 3 years ago
parent 6e1b5c9044
commit 83cd5673d8

@ -120,7 +120,6 @@ function getDom(technologies) {
} }
const Content = { const Content = {
href: location.href,
cache: {}, cache: {},
language: '', language: '',
@ -237,7 +236,7 @@ const Content = {
Content.cache = { html, css, scripts, meta } Content.cache = { html, css, scripts, meta }
await Content.driver('onContentLoad', [ await Content.driver('onContentLoad', [
Content.href, location.href,
Content.cache, Content.cache,
Content.language, Content.language,
]) ])
@ -325,7 +324,7 @@ const Content = {
await Promise.all([ await Promise.all([
Content.onGetTechnologies(technologies, name), Content.onGetTechnologies(technologies, name),
Content.driver('onContentLoad', [ Content.driver('onContentLoad', [
Content.href, location.href,
Content.cache, Content.cache,
Content.language, Content.language,
name, name,
@ -341,14 +340,12 @@ const Content = {
* @param {Array} technologies * @param {Array} technologies
*/ */
async onGetTechnologies(technologies = [], requires) { async onGetTechnologies(technologies = [], requires) {
const url = location.href.split('#')[0]
const js = await getJs(technologies) const js = await getJs(technologies)
const dom = getDom(technologies) const dom = getDom(technologies)
await Promise.all([ await Promise.all([
Content.driver('analyzeJs', [url, js, requires]), Content.driver('analyzeJs', [location.href, js, requires]),
Content.driver('analyzeDom', [url, dom, requires]), Content.driver('analyzeDom', [location.href, dom, requires]),
]) ])
}, },
} }

@ -485,6 +485,8 @@ const Driver = {
incrementHits = false, incrementHits = false,
analyzeRequires = true analyzeRequires = true
) { ) {
url = url.split('#')[0]
if (!url || !detections.length) { if (!url || !detections.length) {
return return
} }

@ -19409,8 +19409,10 @@
"icon": "Square.svg", "icon": "Square.svg",
"js": { "js": {
"SqPaymentForm": "", "SqPaymentForm": "",
"Square.Analytics": "" "Square.Analytics": "",
"__BOOTSTRAP_STATE__.storeInfo.square_application_id": ""
}, },
"xhr": "\\.squareup\\.com",
"scripts": "js\\.squareup\\.com", "scripts": "js\\.squareup\\.com",
"website": "https://squareup.com/" "website": "https://squareup.com/"
}, },
@ -25188,4 +25190,4 @@
"website": "https://www.xt-commerce.com" "website": "https://www.xt-commerce.com"
} }
} }
} }