Prevent repeat analysis of the identical XHR requests

main
Elbert Alias 3 years ago
parent 7a3ed8add4
commit b7b70ecdab

@ -415,6 +415,7 @@ class Site {
}
this.analyzedUrls = {}
this.analyzedXhr = {}
this.analyzedRequires = {}
this.detections = []
@ -549,7 +550,14 @@ class Site {
setTimeout(async () => {
xhrDebounce.splice(xhrDebounce.indexOf(hostname), 1)
await this.onDetect(url, await analyze({ xhr: hostname }))
this.analyzedXhr[url.hostname] =
this.analyzedXhr[url.hostname] || []
if (!this.analyzedXhr[url.hostname].includes(hostname)) {
this.analyzedXhr[url.hostname].push(hostname)
await this.onDetect(url, await analyze({ xhr: hostname }))
}
}, 1000)
}
}

@ -223,6 +223,10 @@ const Wappalyzer = {
},
technologies = Wappalyzer.technologies
) {
if (xhr) {
console.log('analyze', xhr)
}
const oo = Wappalyzer.analyzeOneToOne
const om = Wappalyzer.analyzeOneToMany
const mm = Wappalyzer.analyzeManyToMany