Skip to content

Commit

Permalink
fix: recover if protocol does not support CSS rule usage
Browse files Browse the repository at this point in the history
addresses #1473
  • Loading branch information
patrickhulce committed Jan 17, 2017
1 parent 97d48d3 commit 4be0e28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lighthouse-core/gather/gatherers/css-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class CSSUsage extends Gatherer {
beforePass(options) {
return options.driver.sendCommand('DOM.enable')
.then(_ => options.driver.sendCommand('CSS.enable'))
.then(_ => options.driver.sendCommand('CSS.startRuleUsageTracking'));
.then(_ => options.driver.sendCommand('CSS.startRuleUsageTracking'))
.catch(_ => this.failure = 'CSS Usage tracking requires Chrome \u226556');
}

afterPass(options) {
Expand All @@ -38,7 +39,7 @@ class CSSUsage extends Gatherer {
}).catch(err => {
return {
rawValue: -1,
debugString: err,
debugString: this.failure || err,
};
});
}
Expand Down

0 comments on commit 4be0e28

Please sign in to comment.