From 0c53f79a547159b69d6f1f7d5e6137f7a45535ed Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sat, 25 Nov 2017 12:12:11 +1100 Subject: [PATCH] Catch browser.html() exceptions in NPM driver --- src/drivers/npm/driver.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index 349071184..b54b88a02 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -114,8 +114,15 @@ class Driver { headers[header[0]].push(header[1]); }); + try { + const html = browser.html(); + } catch ( e ) { + this.wappalyzer.log(error.message, 'browser', 'error'); + + return resolve(); + } + const vars = Object.getOwnPropertyNames(browser.window); - const html = browser.html(); const scripts = Array.prototype.slice .apply(browser.document.scripts) .filter(s => s.src)