From 42000f2429c3acf2bd995a92cd2527a95b0515cd Mon Sep 17 00:00:00 2001 From: Abd ar-Rahman Hamidi Date: Sun, 2 Apr 2017 16:44:54 +0500 Subject: [PATCH] Fix not answering any response if no apps detected --- src/drivers/phantomjs/driver.js | 39 +++++++++++++++------------------ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/drivers/phantomjs/driver.js b/src/drivers/phantomjs/driver.js index a99f2612d..83851390d 100644 --- a/src/drivers/phantomjs/driver.js +++ b/src/drivers/phantomjs/driver.js @@ -73,31 +73,28 @@ displayApps: function() { var app, cats, - apps = [], - count = wappalyzer.detected[url] ? Object.keys(wappalyzer.detected[url]).length : 0; + apps = []; wappalyzer.log('driver.displayApps'); - if ( count ) { - for ( app in wappalyzer.detected[url] ) { - cats = []; - - wappalyzer.apps[app].cats.forEach(function(cat) { - cats.push(wappalyzer.categories[cat].name); - }); - - apps.push({ - name: app, - confidence: wappalyzer.detected[url][app].confidenceTotal.toString(), - version: wappalyzer.detected[url][app].version, - icon: wappalyzer.apps[app].icon, - website: wappalyzer.apps[app].website, - categories: cats - }); - } - - wappalyzer.driver.sendResponse(apps); + for ( app in wappalyzer.detected[url] ) { + cats = []; + + wappalyzer.apps[app].cats.forEach(function(cat) { + cats.push(wappalyzer.categories[cat].name); + }); + + apps.push({ + name: app, + confidence: wappalyzer.detected[url][app].confidenceTotal.toString(), + version: wappalyzer.detected[url][app].version, + icon: wappalyzer.apps[app].icon, + website: wappalyzer.apps[app].website, + categories: cats + }); } + + wappalyzer.driver.sendResponse(apps); }, /**