From d2ba9b07fe6c8d7abe23125e4a5797f44991e247 Mon Sep 17 00:00:00 2001 From: Dmitry Manannikov Date: Fri, 19 Dec 2014 14:36:30 -0300 Subject: [PATCH] Show page errors only in verbose mode Phantom sent page errors to stdout, becuse no handler assigned. I add page.onError handler, which use wappalyzer.log [debug] output --- drivers/phantomjs/js/driver.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/phantomjs/js/driver.js b/drivers/phantomjs/js/driver.js index 2ecf483f5..c56e78024 100644 --- a/drivers/phantomjs/js/driver.js +++ b/drivers/phantomjs/js/driver.js @@ -93,6 +93,9 @@ page.onConsoleMessage = function(message) { wappalyzer.log(message); }; + page.onError = function(message) { + wappalyzer.log('Page error: ' + message); + }; page.onResourceReceived = function(response) { if ( response.url.replace(/\/$/, '') === url.replace(/\/$/, '') ) {