Fix page error halting NPM driver

main
Elbert Alias 7 years ago
parent 086d50e839
commit 5c68a1503f

@ -30,7 +30,8 @@ $ node index.js https://wappalyzer.com
```javascript
const options = {
userAgent: 'Wappalyzer',
maxWait: 3000
maxWait: 3000,
debug: false
};
const wappalyzer = require('wappalyzer')(options);

@ -11,8 +11,6 @@ const driver = options => {
const json = JSON.parse(fs.readFileSync(__dirname + '/apps.json'));
return {
quiet: true,
analyze: url => {
const wappalyzer = new Wappalyzer();
@ -25,7 +23,7 @@ const driver = options => {
return reject(message);
}
if ( !driver.quiet ) {
if ( Boolean(options.debug) ) {
console.log('[wappalyzer ' + type + ']', '[' + source + ']', message);
}
};
@ -63,11 +61,12 @@ const driver = options => {
browser.visit(url, error => {
if ( !browser.resources['0'].response ) {
return reject('No response from server');
return wappalyzer.log('No response from server', 'driver', 'error');
}
browser.wait(options.maxWait)
.then(() => {
.catch(error => wappalyzer.log(error.message, 'browser'))
.finally(() => {
wappalyzer.driver.document = browser.document;
const headers = {};
@ -86,8 +85,7 @@ const driver = options => {
html,
env: vars
});
})
.catch(error => reject(error));
});
});
});
}

@ -2,7 +2,8 @@
const options = {
userAgent: null,
maxWait: 3000
maxWait: 3000,
debug: false
};
const args = process.argv.slice(2);

@ -313,7 +313,7 @@ wappalyzer.driver.ping = (hostnameCache, adCache) => {
.then(tracking => {
if ( tracking ) {
if ( Object.keys(hostnameCache).length ) {
post('http://ping.wappalyzer.com/v2/', hostnameCache);
post('http://ping.wappalyzer.com/v3/', hostnameCache);
}
if ( adCache.length ) {

Loading…
Cancel
Save