Fix timeouts in NPM driver

main
Elbert Alias 4 years ago
parent 279345c5d4
commit 476083fb30

@ -345,10 +345,10 @@ class Site {
await sleep(1000)
// Links
const links = await Promise.race([
const links = await (
await Promise.race([
this.timeout(),
(
await page.evaluateHandle(() =>
page.evaluateHandle(() =>
Array.from(document.getElementsByTagName('a')).map(
({ hash, hostname, href, pathname, protocol, rel }) => ({
hash,
@ -359,15 +359,15 @@ class Site {
rel,
})
)
)
).jsonValue(),
),
])
).jsonValue()
// CSS
const css = await Promise.race([
const css = await (
await Promise.race([
this.timeout(),
(
await page.evaluateHandle((maxRows) => {
page.evaluateHandle((maxRows) => {
const css = []
try {
@ -389,27 +389,27 @@ class Site {
}
return css.join('\n')
}, this.options.htmlMaxRows)
).jsonValue(),
}, this.options.htmlMaxRows),
])
).jsonValue()
// Script tags
const scripts = await Promise.race([
const scripts = await (
await Promise.race([
this.timeout(),
(
await page.evaluateHandle(() =>
page.evaluateHandle(() =>
Array.from(document.getElementsByTagName('script'))
.map(({ src }) => src)
.filter((src) => src)
)
).jsonValue(),
),
])
).jsonValue()
// Meta tags
const meta = await Promise.race([
const meta = await (
await Promise.race([
this.timeout(),
(
await page.evaluateHandle(() =>
page.evaluateHandle(() =>
Array.from(document.querySelectorAll('meta')).reduce(
(metas, meta) => {
const key =
@ -423,9 +423,9 @@ class Site {
},
{}
)
)
).jsonValue(),
),
])
).jsonValue()
// JavaScript
const js = await Promise.race([

@ -13,7 +13,7 @@
"software"
],
"homepage": "https://www.wappalyzer.com/",
"version": "6.3.1",
"version": "6.3.2",
"author": "Wappalyzer",
"license": "MIT",
"repository": {

@ -13,7 +13,7 @@
"software"
],
"homepage": "https://www.wappalyzer.com/",
"version": "6.3.1",
"version": "6.3.2",
"author": "Wappalyzer",
"license": "MIT",
"repository": {

Loading…
Cancel
Save