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 = {
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]),
])
},
}

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

@ -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/"
},