Show icon when no technologies are identified, add htmlMaxCols and htmlMaxRows options in NPM driver

main
Elbert Alias 7 years ago
parent 2b57a2c97b
commit dc0031e917

@ -35,6 +35,8 @@ node index.js [url] [options]
--max-wait=ms Wait no more than ms milliseconds for page resources to load.
--recursive=0|1 Follow links on pages (crawler).
--user-agent=str Set the user agent string.
--html-max-cols=num Limit the number of HTML characters per line processed.
--html-max-rows=num Limit the number of HTML lines processed.
```
@ -49,6 +51,8 @@ const options = {
maxWait: 5000,
recursive: true,
userAgent: 'Wappalyzer',
htmlMaxCols: 2000,
htmlMaxRows: 2000,
};
const wappalyzer = new Wappalyzer('https://www.wappalyzer.com', options);

@ -21,6 +21,8 @@ class Driver {
maxWait: 5000,
recursive: false,
userAgent: 'Mozilla/5.0 (compatible; Wappalyzer)',
htmlMaxCols: 2000,
htmlMaxRows: 2000,
}, options || {});
this.options.debug = Boolean(this.options.debug);
@ -28,6 +30,8 @@ class Driver {
this.options.maxDepth = parseInt(this.options.maxDepth, 10);
this.options.maxUrls = parseInt(this.options.maxUrls, 10);
this.options.maxWait = parseInt(this.options.maxWait, 10);
this.options.htmlMaxCols = parseInt(this.options.htmlMaxCols, 10);
this.options.htmlMaxRows = parseInt(this.options.htmlMaxRows, 10);
this.options.recursive = Boolean(this.options.recursive);
this.origPageUrl = url.parse(pageUrl);
@ -216,11 +220,11 @@ class Driver {
let html = '';
try {
html = browser.html();
if ( html.length > 50000 ) {
html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length);
}
html = browser.html()
.split('\n')
.slice(0, this.options.htmlMaxRows / 2).concat(html.slice(html.length - this.options.htmlMaxRows / 2))
.map(line => line.substring(0, this.options.htmlMaxCols))
.join('\n');
} catch ( error ) {
this.wappalyzer.log(error.message, 'browser', 'error');
}

@ -148,7 +148,7 @@ body {
.empty {
display: flex;
height: 16rem;
height: 14.5rem;
align-items: center;
justify-content: center;
}

@ -240,7 +240,6 @@ wappalyzer.driver.displayApps = (detected, meta, context) => {
tabCache[tab.id].detected = detected;
if ( Object.keys(detected).length ) {
var appName, found = false;
// Find the main application to display
@ -281,7 +280,6 @@ wappalyzer.driver.displayApps = (detected, meta, context) => {
} else {
browser.pageAction.show(tab.id);
}
}
};
/**

@ -72,5 +72,3 @@
],
"content_security_policy": "script-src 'self'; object-src 'self'"
}