Bug 1530199 - Remove hasSupportsHighlighters check in supportsEyeDropper r=gl
authorlloan <lloanalas@outlook.com>
Thu, 28 Feb 2019 20:33:45 +0000
changeset 519861 9b1e57540da771540bf6dc10be8c150582ee1b84
parent 519860 df9abfd88677beb8d5838f4f0dc923bf4036ca4c
child 519862 47629d4e3150e77e91201d93d5d9e8b7cda8f909
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1530199
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
devtools/client/inspector/inspector.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -1015,30 +1015,17 @@ Inspector.prototype = {
    * Method to check whether the document is a HTML document and
    * pickColorFromPage method is available or not.
    *
    * @return {Boolean} true if the eyedropper highlighter is supported by the current
    *         document.
    */
   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;
     }
   },
 
   async setupToolbar() {
     this.teardownToolbar();