|
|
@ -21,6 +21,16 @@ const xhrDebounce = []
|
|
|
|
|
|
|
|
|
|
|
|
const scriptsPending = []
|
|
|
|
const scriptsPending = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getRequiredTechnologies(name, categoryId) {
|
|
|
|
|
|
|
|
return name
|
|
|
|
|
|
|
|
? Wappalyzer.requires.find(({ name: _name }) => _name === name).technologies
|
|
|
|
|
|
|
|
: categoryId
|
|
|
|
|
|
|
|
? Wappalyzer.categoryRequires.find(
|
|
|
|
|
|
|
|
({ categoryId: _categoryId }) => _categoryId === categoryId
|
|
|
|
|
|
|
|
).technologies
|
|
|
|
|
|
|
|
: undefined
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const Driver = {
|
|
|
|
const Driver = {
|
|
|
|
lastPing: Date.now(),
|
|
|
|
lastPing: Date.now(),
|
|
|
|
|
|
|
|
|
|
|
@ -198,10 +208,8 @@ const Driver = {
|
|
|
|
* @param {String} url
|
|
|
|
* @param {String} url
|
|
|
|
* @param {Array} js
|
|
|
|
* @param {Array} js
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async analyzeJs(url, js, requires) {
|
|
|
|
async analyzeJs(url, js, requires, categoryRequires) {
|
|
|
|
const technologies = requires
|
|
|
|
const technologies = getRequiredTechnologies(requires, categoryRequires)
|
|
|
|
? Wappalyzer.requires.find(({ name }) => name === requires).technologies
|
|
|
|
|
|
|
|
: Wappalyzer.technologies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Driver.onDetect(
|
|
|
|
return Driver.onDetect(
|
|
|
|
url,
|
|
|
|
url,
|
|
|
@ -227,10 +235,8 @@ const Driver = {
|
|
|
|
* @param {String} url
|
|
|
|
* @param {String} url
|
|
|
|
* @param {Array} dom
|
|
|
|
* @param {Array} dom
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async analyzeDom(url, dom, requires) {
|
|
|
|
async analyzeDom(url, dom, requires, categoryRequires) {
|
|
|
|
const technologies = requires
|
|
|
|
const technologies = getRequiredTechnologies(requires, categoryRequires)
|
|
|
|
? Wappalyzer.requires[requires].technologies
|
|
|
|
|
|
|
|
: Wappalyzer.technologies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Driver.onDetect(
|
|
|
|
return Driver.onDetect(
|
|
|
|
url,
|
|
|
|
url,
|
|
|
@ -468,7 +474,7 @@ const Driver = {
|
|
|
|
* @param {Object} items
|
|
|
|
* @param {Object} items
|
|
|
|
* @param {String} language
|
|
|
|
* @param {String} language
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async onContentLoad(url, items, language, requires) {
|
|
|
|
async onContentLoad(url, items, language, requires, categoryRequires) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
items.cookies = items.cookies || {}
|
|
|
|
items.cookies = items.cookies || {}
|
|
|
|
|
|
|
|
|
|
|
@ -481,12 +487,11 @@ const Driver = {
|
|
|
|
({ name, value }) => (items.cookies[name.toLowerCase()] = [value])
|
|
|
|
({ name, value }) => (items.cookies[name.toLowerCase()] = [value])
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const technologies = getRequiredTechnologies(requires, categoryRequires)
|
|
|
|
|
|
|
|
|
|
|
|
await Driver.onDetect(
|
|
|
|
await Driver.onDetect(
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
await analyze(
|
|
|
|
await analyze({ url, ...items }, technologies),
|
|
|
|
{ url, ...items },
|
|
|
|
|
|
|
|
requires ? Wappalyzer.requires[requires].technologies : undefined
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
language,
|
|
|
|
language,
|
|
|
|
true
|
|
|
|
true
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -533,10 +538,6 @@ const Driver = {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Driver.log([
|
|
|
|
|
|
|
|
...new Set(detections.map(({ technology }) => technology.name)),
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
url = url.split('#')[0]
|
|
|
|
url = url.split('#')[0]
|
|
|
|
|
|
|
|
|
|
|
|
const { hostname } = new URL(url)
|
|
|
|
const { hostname } = new URL(url)
|
|
|
@ -632,9 +633,16 @@ const Driver = {
|
|
|
|
return detection
|
|
|
|
return detection
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const requires = Wappalyzer.requires.filter(({ name, technologies }) =>
|
|
|
|
const requires = [
|
|
|
|
resolved.some(({ name: _name }) => _name === name)
|
|
|
|
...Wappalyzer.requires.filter(({ name }) =>
|
|
|
|
)
|
|
|
|
resolved.some(({ name: _name }) => _name === name)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
...Wappalyzer.categoryRequires.filter(({ categoryId }) =>
|
|
|
|
|
|
|
|
resolved.some(({ categories }) =>
|
|
|
|
|
|
|
|
categories.some(({ id }) => id === categoryId)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
await Driver.content(url, 'analyzeRequires', [url, requires])
|
|
|
|
await Driver.content(url, 'analyzeRequires', [url, requires])
|
|
|
|