Skip to content

Commit

Permalink
fix(domstats): enable DOM domain (#2640)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhulce authored and paulirish committed Jul 5, 2017
1 parent e5f3a7b commit 3ee5215
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lighthouse-core/gather/gatherers/dobetterweb/domstats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}));
}
}
Expand Down

0 comments on commit 3ee5215

Please sign in to comment.