Review DevTools slow script handler logic
Categories
(DevTools :: General, task, P4)
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.
| Reporter | ||
Comment 1•5 years ago
|
||
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:
- open https://incredible-planet-caravan.glitch.me/ (simple page with a
while (true) {}blocking the load) - wait for the slow script
- click on Debug
ER:
Debugger should open
AR:
Nothing happens. If before the STRs you open the DevTools menu or open the Toolbox, the debugger will open.
| Reporter | ||
Comment 2•5 years ago
•
|
||
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.
Description
•