Add CSS inspection to NPM driver

main
Elbert Alias 4 years ago
parent ff61200e5c
commit 2066f0c216

@ -363,6 +363,36 @@ class Site {
).jsonValue(),
])
// CSS
const css = await Promise.race([
this.timeout(),
(
await page.evaluateHandle((maxRows) => {
const css = []
try {
if (!document.styleSheets.length) {
return ''
}
for (const sheet of Array.from(document.styleSheets)) {
for (const rules of Array.from(sheet.cssRules)) {
css.push(rules.cssText)
if (css.length >= maxRows) {
break
}
}
}
} catch (error) {
return ''
}
return css.join('\n')
}, this.options.htmlMaxRows)
).jsonValue(),
])
// Script tags
const scripts = await Promise.race([
this.timeout(),
@ -483,6 +513,7 @@ class Site {
url,
cookies,
html,
css,
scripts,
meta,
})

@ -20,9 +20,14 @@
"type": "git",
"url": "https://github.com/aliasio/wappalyzer"
},
"funding": {
"funding": [
{
"url": "https://github.com/sponsors/aliasio"
},
{
"url": "https://paypal.me/aliasio"
}
],
"main": "driver.js",
"files": [
"cli.js",

@ -20,9 +20,14 @@
"type": "git",
"url": "https://github.com/aliasio/wappalyzer"
},
"funding": {
"funding": [
{
"url": "https://github.com/sponsors/aliasio"
},
{
"url": "https://paypal.me/aliasio"
}
],
"main": "wappalyzer.js",
"files": [
"wappalyzer.js"

@ -5014,6 +5014,10 @@
41
],
"html": "<[^>]+aria-labelledby=\"pi-google_pay",
"scripts": [
"checkout\\.google\\.com",
"wallet\\.google\\.com"
],
"icon": "Google.svg",
"website": "https://pay.google.com"
},
@ -5065,17 +5069,6 @@
},
"website": "http://www.google.com/tagmanager"
},
"Google Wallet": {
"cats": [
41
],
"icon": "Google Wallet.png",
"scripts": [
"checkout\\.google\\.com",
"wallet\\.google\\.com"
],
"website": "http://wallet.google.com"
},
"Google Web Server": {
"cats": [
22
@ -10859,6 +10852,7 @@
},
"scripts": "sdks\\.shopifycdn\\.com",
"url": "^https?//.+\\.myshopify\\.com",
"description": "Shopify is a commerce platform that allows anyone to set up a store and sell their products online or in person.",
"website": "http://shopify.com"
},
"Shopline": {