simple-wappalyzer 1.1.76 → 1.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/index.js +21 -14
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "simple-wappalyzer",
|
|
3
3
|
"description": "A simple way to interacting with Wappalyzer.",
|
|
4
4
|
"homepage": "https://github.com/Kikobeats/simple-wappalyzer",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.78",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "josefrancisco.verdu@gmail.com",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"got": "~11.8.6",
|
|
32
|
-
"
|
|
32
|
+
"happy-dom": "~15.7.0",
|
|
33
33
|
"lodash": "~4.17.21",
|
|
34
34
|
"tough-cookie": "~6.0.0",
|
|
35
|
-
"wappalyzer-core": "
|
|
35
|
+
"wappalyzer-core": "6",
|
|
36
36
|
"write-json-file": "~4.3.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
package/src/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
const { chain, mapValues } = require('lodash')
|
|
4
4
|
const wappalyzer = require('wappalyzer-core')
|
|
5
5
|
const { Cookie } = require('tough-cookie')
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const { JSDOM, VirtualConsole } = jsdom
|
|
6
|
+
const { Window } = require('happy-dom')
|
|
9
7
|
|
|
10
8
|
const technologies = require('./technologies.json')
|
|
11
9
|
const categories = require('./categories.json')
|
|
@@ -25,12 +23,7 @@ const getCookies = str =>
|
|
|
25
23
|
|
|
26
24
|
const getHeaders = headers => mapValues(headers, value => [value])
|
|
27
25
|
|
|
28
|
-
const getScripts = scripts =>
|
|
29
|
-
chain(scripts)
|
|
30
|
-
.map('src')
|
|
31
|
-
.compact()
|
|
32
|
-
.uniq()
|
|
33
|
-
.value()
|
|
26
|
+
const getScripts = scripts => chain(scripts).map('src').compact().uniq().value()
|
|
34
27
|
|
|
35
28
|
const getHeader = (headers, name) => {
|
|
36
29
|
name = name.toLowerCase()
|
|
@@ -49,18 +42,32 @@ const getMeta = document =>
|
|
|
49
42
|
}, {})
|
|
50
43
|
|
|
51
44
|
module.exports = async ({ url, headers, html }) => {
|
|
52
|
-
const
|
|
45
|
+
const window = new Window({
|
|
46
|
+
url,
|
|
47
|
+
settings: {
|
|
48
|
+
disableComputedStyleRendering: true,
|
|
49
|
+
disableCSSFileLoading: true,
|
|
50
|
+
disableIframePageLoading: true,
|
|
51
|
+
disableJavaScriptEvaluation: true,
|
|
52
|
+
disableJavaScriptFileLoading: true
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
window.document.documentElement.innerHTML = html
|
|
53
57
|
|
|
54
58
|
const detections = await wappalyzer.analyze({
|
|
55
59
|
url,
|
|
56
|
-
meta: getMeta(
|
|
60
|
+
meta: getMeta(window.document),
|
|
57
61
|
headers: getHeaders(headers),
|
|
58
|
-
scripts: getScripts(
|
|
62
|
+
scripts: getScripts(window.document.scripts),
|
|
59
63
|
cookies: getCookies(getHeader(headers, 'set-cookie')),
|
|
60
|
-
html:
|
|
64
|
+
html: window.document.documentElement.outerHTML
|
|
61
65
|
})
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
const result = wappalyzer.resolve(detections)
|
|
68
|
+
window.close()
|
|
69
|
+
|
|
70
|
+
return result
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
module.exports.getHeader = getHeader
|