Add file:// support, fix timeout in NPM driver

main
Elbert Alias 4 years ago
parent 5c241d49e1
commit 7f99a67f70

@ -11194,10 +11194,8 @@
10
],
"icon": "splitbee.svg",
"js": {
"splitbee": ""
},
"script": "^https://cdn\\.splitbee\\.io/sb\\.js",
"js": { "splitbee": "" },
"website": "https://splitbee.io"
},
"Splunk": {
@ -11395,6 +11393,7 @@
"website": "https://strikingly.com"
},
"Stripe": {
"description": "Stripe offers online payment processing for internet businesses.",
"cats": [
41
],
@ -12707,10 +12706,10 @@
"website": "https://www.volusion.com"
},
"Vue.js": {
"description": "Vue is a progressive framework for building user interfaces.",
"cats": [
12
],
"description": "Vue is a progressive framework for building user interfaces.",
"html": "<[^>]+\\sdata-v(?:ue)?-",
"icon": "vue.svg",
"js": {

@ -197,10 +197,9 @@ class Site {
timeout() {
return new Promise((resolve, reject) =>
setTimeout(
() => reject(new Error('The website took too long to respond')),
this.options.maxWait
)
setTimeout(() => {
reject(new Error('The website took too long to respond'))
}, this.options.maxWait)
)
}
@ -301,7 +300,7 @@ class Site {
try {
await Promise.race([
await this.timeout(),
this.timeout(),
page.goto(url.href, { waitUntil: 'domcontentloaded' })
])
@ -309,7 +308,7 @@ class Site {
// Links
const links = await Promise.race([
await this.timeout(),
this.timeout(),
(
await page.evaluateHandle(() =>
Array.from(document.getElementsByTagName('a')).map(
@ -328,7 +327,7 @@ class Site {
// Script tags
const scripts = await Promise.race([
await this.timeout(),
this.timeout(),
(
await page.evaluateHandle(() =>
Array.from(document.getElementsByTagName('script'))
@ -340,7 +339,7 @@ class Site {
// Meta tags
const meta = await Promise.race([
await this.timeout(),
this.timeout(),
(
await page.evaluateHandle(() =>
Array.from(document.querySelectorAll('meta')).reduce(
@ -362,7 +361,7 @@ class Site {
// JavaScript
const js = await Promise.race([
await this.timeout(),
this.timeout(),
page.evaluate(
(technologies) => {
return technologies.reduce((technologies, { name, chains }) => {
@ -432,7 +431,7 @@ class Site {
}
// Validate response
if (!this.analyzedUrls[url.href].status) {
if (url.protocol !== 'file:' && !this.analyzedUrls[url.href].status) {
await page.close()
this.log('Page closed')
@ -442,7 +441,7 @@ class Site {
if (!this.language) {
this.language = await Promise.race([
await this.timeout(),
this.timeout(),
(
await page.evaluateHandle(
() =>

Loading…
Cancel
Save