Fix scriptSrc detection

main
Elbert Alias 3 years ago
parent 046b40e69e
commit d22ef20bc2

@ -750,7 +750,7 @@ class Site {
) )
// Script tags // Script tags
;[scripts, scriptSrc] = await this.promiseTimeout( ;[scriptSrc, scripts] = await this.promiseTimeout(
( (
await this.promiseTimeout( await this.promiseTimeout(
page.evaluateHandle(() => { page.evaluateHandle(() => {
@ -760,22 +760,22 @@ class Site {
return [ return [
nodes nodes
.map( .filter(
({ src }) => ({ src }) =>
src && !src.startsWith('data:text/javascript;') src && !src.startsWith('data:text/javascript;')
) )
.filter((src) => src), .map(({ src }) => src),
nodes nodes
.map((node) => node.textContent) .map((node) => node.textContent)
.filter((script) => script), .filter((script) => script),
] ]
}), }),
{ jsonValue: () => [] }, { jsonValue: () => [] },
'Timeout (scriptSrc)' 'Timeout (scripts)'
) )
).jsonValue(), ).jsonValue(),
[], [],
'Timeout (scriptSrc)' 'Timeout (scripts)'
) )
// Meta tags // Meta tags