Closed Bug 1209353 Opened 9 years ago Closed 5 years ago

[meta] Worker debugger console do not work

Categories

(DevTools :: Console, task)

task
Not set
normal

Tracking

(firefox44 affected)

RESOLVED FIXED
Tracking Status
firefox44 --- affected

People

(Reporter: canuckistani, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: meta)

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
Status: NEW → ASSIGNED
See Also: → 1201962
Depends on: 1215117
Depends on: 1215120
Depends on: 1217590
Depends on: 1217591
Keywords: meta
Summary: Worker debugger console / scratchpad do not work → [meta] Worker debugger console / scratchpad do not work
Assignee: bgrinstead → nobody
Status: ASSIGNED → NEW
Depends on: 1224073
Depends on: 1240851
Turning this into the meta bug for making the console work in the worker debugger.
Blocks: 1246091, 1249709
Component: Developer Tools: Debugger → Developer Tools: Console
Summary: [meta] Worker debugger console / scratchpad do not work → [meta] Worker debugger console do not work
Depends on: 1252945
Depends on: 1252958
This is not really part of the Push DevTools for Dev. Edition 47, so I'm unblocking said meta-bug.
No longer blocks: 1214248
No longer blocks: 1246091, 1249709
Depends on: 1246091, 1249709
Depends on: 1259603
Product: Firefox → DevTools
Type: defect → task

The issue reported here is fixed, console is working for workers.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.