Closed Bug 1209353 Opened 6 years ago Closed 2 years ago
[meta] Worker debugger console do not work
ER: if I'm at a breakpoint in worker code, I should be able to use the console AR: the console is dead, nothing happens. Scratchpad is also dead, eg running `console.log(this)` gets nothing.
As discussed, I've started to investigate why the console isn't working with workers. A rough outline: The primary failure is that there is no WebConsoleActor being created for the worker's debugger server connection - right now only a ThreadActor is being created: https://dxr.mozilla.org/mozilla-central/source/devtools/server/worker.js#57 * The webconsole frontend blows up because it's expecting an actor ID at target.form.consoleActor for its call to attachConsole (https://dxr.mozilla.org/mozilla-central/source/devtools/client/webconsole/webconsole.js#5035) In order to load the WebConsoleActor in the worker scope it's going to require some changes. * There need to be some cosmetic changes with loading in the WebConsoleActor: https://dxr.mozilla.org/mozilla-central/source/devtools/server/actors/webconsole.js. Also just general fixes (call DevToolsUtils.reportException instead of Cu.reportError, etc) * What's going to be trickier is making WebConsoleUtils work (which is imported into the console actor). This file relies on Services / XPCOM stuff to add console listeners . For example, to listen to console api messages, it needs to listen to Services.obs.addObserver(this, "console-api-log-event", false): https://dxr.mozilla.org/mozilla-central/source/devtools/shared/webconsole/utils.js#1373. ** I think we need to do some trickery with rpc to the main thread like what fetch is doing: https://dxr.mozilla.org/mozilla-central/source/devtools/shared/DevToolsUtils.js#637-646. Only this will be more complex since we'll need to rpc to set up the listeners, then be notified of updates with unsolicited events to the worker. And the main thread console listeners will need to do some of what the WCA is currently doing, like preparing the message for remote since the listeners currently pass around instances of nsIConsoleMessage / nsIScriptError etc. * REPL is easier since it's mostly protocol stuff and not services. I'm seeing some progress on this front, like being able to run REPL commands when not paused at a frame.
Assignee: nobody → bgrinstead
Summary: Worker debugger console / scratchpad do not work → [meta] Worker debugger console / scratchpad do not work
Turning this into the meta bug for making the console work in the worker debugger.
This is not really part of the Push DevTools for Dev. Edition 47, so I'm unblocking said meta-bug.
No longer blocks: 1214248
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.