Bug 1774937 - Show the debug slow script button if DevTools are opened on all releases. r=jdescottes,dthayer
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 30 Jun 2022 17:18:54 +0000
changeset 622738 39fe8edd4b83dc3e9b784db22ef8b74179ff21e3
parent 622737 deaafcc8226e01f923775be46d3373dfb05d0ef1
child 622739 a472404e52f7ce605f6d7ba9d66bc3728529c77d
push id165545
push userapoirot@mozilla.com
push dateThu, 30 Jun 2022 17:21:31 +0000
treeherderautoland@a545a227cec1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes, dthayer
bugs1774937
milestone104.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 1774937 - Show the debug slow script button if DevTools are opened on all releases. r=jdescottes,dthayer Differential Revision: https://phabricator.services.mozilla.com/D150153
browser/modules/ProcessHangMonitor.jsm
--- a/browser/modules/ProcessHangMonitor.jsm
+++ b/browser/modules/ProcessHangMonitor.jsm
@@ -553,17 +553,22 @@ var ProcessHangMonitor = {
     }
 
     if (notification) {
       notification.label = message;
       notification.setAttribute("notification-tag", notificationTag);
       return;
     }
 
-    if (AppConstants.MOZ_DEV_EDITION) {
+    // Show the "debug script" button unconditionally if we are in Developer edition,
+    // or, if DevTools are opened on the slow tab.
+    if (
+      AppConstants.MOZ_DEV_EDITION ||
+      report.scriptBrowser.browsingContext.watchedByDevTools
+    ) {
       buttons.push({
         label: bundle.getString("processHang.button_debug.label"),
         accessKey: bundle.getString("processHang.button_debug.accessKey"),
         callback() {
           ProcessHangMonitor.debugScript(win);
         },
       });
     }