Bug 1530199 - Remove hasSupportsHighlighters check in supportsEyeDropper r=gl

Cleans up the try statement of supportsEyeDropper https://searchfox.org/mozilla-central/source/devtools/client/inspector/inspector.js#1036 by removing the hasSupportsHighlighters check and simplifying it to do a single return:
```
return await this.inspector.supportsHighlighters()
```

Differential Revision: https://phabricator.services.mozilla.com/D21265

--HG--
extra : moz-landing-system : lando
This commit is contained in:
lloan 2019-02-28 20:33:45 +00:00
parent 0b5eea3982
commit 9d53cb56b4

View File

@ -1020,20 +1020,7 @@ Inspector.prototype = {
*/
async supportsEyeDropper() {
try {
const hasSupportsHighlighters =
await this.target.actorHasMethod("inspector", "supportsHighlighters");
let supportsHighlighters;
if (hasSupportsHighlighters) {
supportsHighlighters = await this.inspector.supportsHighlighters();
} else {
// If the actor does not provide the supportsHighlighter method, fallback to
// check if the selected node's document is a HTML document.
const { nodeFront } = this.selection;
supportsHighlighters = nodeFront && nodeFront.isInHTMLDocument;
}
return supportsHighlighters;
return await this.inspector.supportsHighlighters();
} catch (e) {
console.error(e);
return false;