mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
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:
parent
0b5eea3982
commit
9d53cb56b4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user