Update Node.js dependency

main
Elbert Alias 3 years ago
parent 5a38edb3d5
commit e755746978

@ -16,7 +16,7 @@ If you don't have time to configure, host, debug and maintain your own infrastru
## Prerequisites
- [Git](https://git-scm.com)
- [Node.js](https://nodejs.org) version 12 or higher
- [Node.js](https://nodejs.org) version 14 or higher
- [Yarn](https://yarnpkg.com)
## Quick start

@ -64,7 +64,7 @@
7
],
"name": "Hosting panels",
"priority": 1
"priority": 2
},
"10": {
"groups": [
@ -136,7 +136,7 @@
6
],
"name": "Miscellaneous",
"priority": 9
"priority": 10
},
"20": {
"groups": [

@ -552,7 +552,7 @@ class Site {
if (!this.analyzedXhr[url.hostname].includes(hostname)) {
this.analyzedXhr[url.hostname].push(hostname)
await this.onDetect(url, await analyze({ xhr: hostname }))
await this.onDetect(url, analyze({ xhr: hostname }))
}
}, 1000)
}
@ -590,7 +590,7 @@ class Site {
) {
const scripts = await response.text()
await this.onDetect(response.url(), await analyze({ scripts }))
await this.onDetect(response.url(), analyze({ scripts }))
}
if (response.url() === url.href) {
@ -634,7 +634,7 @@ class Site {
? response.securityDetails().issuer()
: ''
await this.onDetect(url, await analyze({ headers, certIssuer }))
await this.onDetect(url, analyze({ headers, certIssuer }))
await this.emit('response', { page, response, headers, certIssuer })
}
@ -1076,10 +1076,7 @@ class Site {
this.log(`Probe ok (${path})`)
await this.onDetect(
url,
await analyze({ [file]: body.slice(0, 100000) })
)
await this.onDetect(url, analyze({ [file]: body.slice(0, 100000) }))
} catch (error) {
this.error(`Probe failed (${path}): ${error.message || error}`)
}
@ -1117,7 +1114,7 @@ class Site {
`Probe DNS ok: (${Object.values(dnsRecords).flat().length} records)`
)
await this.onDetect(url, await analyze({ dns: dnsRecords }))
await this.onDetect(url, analyze({ dns: dnsRecords }))
resolve()
}),

@ -42,5 +42,8 @@
},
"dependencies": {
"puppeteer": "^10.4.0"
},
"engines": {
"node": ">=14"
}
}

@ -416,9 +416,7 @@ const Driver = {
)
})
Driver.onDetect(request.url, await analyze({ headers })).catch(
Driver.error
)
Driver.onDetect(request.url, analyze({ headers })).catch(Driver.error)
}
} catch (error) {
Driver.error(error)
@ -444,7 +442,7 @@ const Driver = {
const scripts = await response.text()
Driver.onDetect(request.documentUrl, await analyze({ scripts })).catch(
Driver.onDetect(request.documentUrl, analyze({ scripts })).catch(
Driver.error
)
}
@ -492,7 +490,7 @@ const Driver = {
Driver.onDetect(
request.originUrl || request.initiator,
await analyze({ xhr: hostname })
analyze({ xhr: hostname })
).catch(Driver.error)
}
}, 1000)
@ -522,7 +520,7 @@ const Driver = {
await Driver.onDetect(
url,
await analyze({ url, ...items }, technologies),
analyze({ url, ...items }, technologies),
language,
true
)

@ -1,9 +1,5 @@
'use strict'
function next() {
return new Promise((resolve) => setTimeout(resolve, 0))
}
function toArray(value) {
return Array.isArray(value) ? value : [value]
}
@ -204,7 +200,7 @@ const Wappalyzer = {
* Initialize analyzation.
* @param {*} param0
*/
async analyze(
analyze(
{
url,
xhr,
@ -231,28 +227,24 @@ const Wappalyzer = {
try {
const detections = flatten(
await Promise.all(
technologies.map(async (technology) => {
await next()
return flatten([
oo(technology, 'url', url),
oo(technology, 'xhr', xhr),
oo(technology, 'html', html),
oo(technology, 'text', text),
oo(technology, 'scripts', scripts),
oo(technology, 'css', css),
oo(technology, 'robots', robots),
oo(technology, 'magento', magento),
oo(technology, 'certIssuer', certIssuer),
om(technology, 'scriptSrc', scriptSrc),
mm(technology, 'cookies', cookies),
mm(technology, 'meta', meta),
mm(technology, 'headers', headers),
mm(technology, 'dns', dns),
])
})
)
technologies.map((technology) => {
return flatten([
oo(technology, 'url', url),
oo(technology, 'xhr', xhr),
oo(technology, 'html', html),
oo(technology, 'text', text),
oo(technology, 'scripts', scripts),
oo(technology, 'css', css),
oo(technology, 'robots', robots),
oo(technology, 'magento', magento),
oo(technology, 'certIssuer', certIssuer),
om(technology, 'scriptSrc', scriptSrc),
mm(technology, 'cookies', cookies),
mm(technology, 'meta', meta),
mm(technology, 'headers', headers),
mm(technology, 'dns', dns),
])
})
).filter((technology) => technology)
return detections