Open Bug 1692491 Opened 5 years ago Updated 20 days ago

Review DevTools slow script handler logic

Categories

(DevTools :: General, task, P4)

task

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

DevTools are listening to the slow script debug service in order to open the debugger when the user clicks on the "debug" button of the slow script popup:

    const debugService = Cc["@mozilla.org/dom/slow-script-debug;1"].getService(
      Ci.nsISlowScriptDebug
    );

Currently we start listening to this service when building the devtools menu, which happens either when opening DevTools or when opening the menu.

This probably means that if users get the popup before doing any of those things, the debug button doesn't work?

In any case the coupling is odd and it would probably make more sense to setup the listener from DevToolsStartup.jsm (while taking care of delaying this until the first window is opened).

Note that the slow script popup is being discussed internally at https://jira.mozilla.com/browse/FFXP-106
We should check the status of the discussion before refactoring this, it might impact our decisions.

It seems that the debug button is only show in the slow script UI on Dev Edition. Other channels only give the options to wait/stop the script.

But I confirmed that on DevEdition, opening a page that triggers the slow script warning and clicking on Debug will not open the Debugger unless you previously opened DevTools or opened the DevTools menu.

STRs:

ER:
Debugger should open
AR:
Nothing happens. If before the STRs you open the DevTools menu or open the Toolbox, the debugger will open.

Also note that in the example above, even though the debugger opens if you used devtools before, it doesn't break or help the user find the slow script in any way.
The feature seems partly broken for now.

See Also: → 1774937
You need to log in before you can comment on or make changes to this bug.