|
|
@ -65,16 +65,25 @@ function getJs(page, technologies = Wappalyzer.technologies) {
|
|
|
|
chains.forEach((chain) => {
|
|
|
|
chains.forEach((chain) => {
|
|
|
|
chain = chain.replace(/\[([^\]]+)\]/g, '.$1')
|
|
|
|
chain = chain.replace(/\[([^\]]+)\]/g, '.$1')
|
|
|
|
|
|
|
|
|
|
|
|
const value = chain
|
|
|
|
const parts = chain.split('.')
|
|
|
|
.split('.')
|
|
|
|
|
|
|
|
.reduce(
|
|
|
|
const root = /^[a-z_$][a-z0-9_$]*$/i.test(parts[0])
|
|
|
|
|
|
|
|
? // eslint-disable-next-line no-new-func
|
|
|
|
|
|
|
|
new Function(
|
|
|
|
|
|
|
|
`return typeof ${
|
|
|
|
|
|
|
|
parts[0]
|
|
|
|
|
|
|
|
} === 'undefined' ? undefined : ${parts.shift()}`
|
|
|
|
|
|
|
|
)()
|
|
|
|
|
|
|
|
: window
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const value = parts.reduce(
|
|
|
|
(value, method) =>
|
|
|
|
(value, method) =>
|
|
|
|
value &&
|
|
|
|
value &&
|
|
|
|
value instanceof Object &&
|
|
|
|
value instanceof Object &&
|
|
|
|
Object.prototype.hasOwnProperty.call(value, method)
|
|
|
|
Object.prototype.hasOwnProperty.call(value, method)
|
|
|
|
? value[method]
|
|
|
|
? value[method]
|
|
|
|
: '__UNDEFINED__',
|
|
|
|
: '__UNDEFINED__',
|
|
|
|
window
|
|
|
|
root || '__UNDEFINED__'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if (value !== '__UNDEFINED__') {
|
|
|
|
if (value !== '__UNDEFINED__') {
|
|
|
|