Bug 1539688: Avoid to call listTabs() if the tab category does not display. r=jdescottes
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 08 May 2019 08:54:39 +0000
changeset 534909 340bf0a7176dfbbff8d47ad5a2df9da1715e3679
parent 534908 1b84518177e73dba6d06f515d3a09373ca19cfe7
child 534910 dfcf9fbbd09fb7fb4cae5808e11b46d9b9c21184
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1539688
milestone68.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 1539688: Avoid to call listTabs() if the tab category does not display. r=jdescottes Differential Revision: https://phabricator.services.mozilla.com/D30315
devtools/client/aboutdebugging-new/src/actions/debug-targets.js
--- a/devtools/client/aboutdebugging-new/src/actions/debug-targets.js
+++ b/devtools/client/aboutdebugging-new/src/actions/debug-targets.js
@@ -6,28 +6,31 @@
 
 const { AddonManager } = require("resource://gre/modules/AddonManager.jsm");
 const { remoteClientManager } =
   require("devtools/client/shared/remote-debugging/remote-client-manager");
 const Services = require("Services");
 
 const { l10n } = require("../modules/l10n");
 
+const { isSupportedDebugTargetPane } = require("../modules/debug-target-support");
+
 const {
   openTemporaryExtension,
   uninstallAddon,
 } = require("../modules/extensions-helper");
 
 const {
   getCurrentClient,
   getCurrentRuntime,
 } = require("../modules/runtimes-state-helper");
 
 const {
   DEBUG_TARGETS,
+  DEBUG_TARGET_PANE,
   REQUEST_EXTENSIONS_FAILURE,
   REQUEST_EXTENSIONS_START,
   REQUEST_EXTENSIONS_SUCCESS,
   REQUEST_PROCESSES_FAILURE,
   REQUEST_PROCESSES_START,
   REQUEST_PROCESSES_SUCCESS,
   REQUEST_TABS_FAILURE,
   REQUEST_TABS_START,
@@ -157,20 +160,23 @@ function removeTemporaryExtension(id) {
     }
   };
 }
 
 function requestTabs() {
   return async (dispatch, getState) => {
     dispatch({ type: REQUEST_TABS_START });
 
+    const runtime = getCurrentRuntime(getState().runtimes);
     const clientWrapper = getCurrentClient(getState().runtimes);
 
     try {
-      const tabs = await clientWrapper.listTabs({ favicons: true });
+      const isSupported = isSupportedDebugTargetPane(runtime.runtimeDetails.info.type,
+                                                     DEBUG_TARGET_PANE.TAB);
+      const tabs = isSupported ? (await clientWrapper.listTabs({ favicons: true })) : [];
 
       dispatch({ type: REQUEST_TABS_SUCCESS, tabs });
     } catch (e) {
       dispatch({ type: REQUEST_TABS_FAILURE, error: e });
     }
   };
 }