From 3ee521597f30518912cf9f3b46a3cbf714b15f5b Mon Sep 17 00:00:00 2001 From: Patrick Hulce Date: Wed, 5 Jul 2017 10:33:53 -0500 Subject: [PATCH] fix(domstats): enable DOM domain (#2640) --- lighthouse-core/gather/gatherers/dobetterweb/domstats.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lighthouse-core/gather/gatherers/dobetterweb/domstats.js b/lighthouse-core/gather/gatherers/dobetterweb/domstats.js index b0490ff5e846..93187fc2f6f0 100644 --- a/lighthouse-core/gather/gatherers/dobetterweb/domstats.js +++ b/lighthouse-core/gather/gatherers/dobetterweb/domstats.js @@ -137,10 +137,11 @@ class DOMStats extends Gatherer { ${elementPathInDOM.toString()}; return (${getDOMStats.toString()}(document.documentElement)); })()`; - return options.driver.evaluateAsync(expression) + return options.driver.sendCommand('DOM.enable') + .then(() => options.driver.evaluateAsync(expression)) .then(results => options.driver.getElementsInDocument().then(allNodes => { results.totalDOMNodes = allNodes.length; - return results; + return options.driver.sendCommand('DOM.disable').then(() => results); })); } }