Closed Bug 1848159 Opened 9 months ago Closed 3 months ago

Allow tracing across navigations


(DevTools :: Debugger, enhancement)



(firefox124 fixed)

124 Branch
Tracking Status
firefox124 --- fixed


(Reporter: ochameau, Assigned: ochameau)


(Blocks 1 open bug)



(4 files)

For now, the javascript tracer automatically shuts down on navigation.
It would be nice for it to persist across navigations so that we can debug code fired during load.
An alternative which could be helpful would be to allow starting the tracer on load.
This would allow to distinguish code running until unload versus code running from load.

Because the JavaScript tracer is currently running in each process/thread/target actor independently,
it is more complex to make it record across navigations as it may be spawn in a distinct process.

While it is fine for stdout and webconsole outputs (we could just spawn many concurrent tracers in each process),
this is more complex for the experimental "profiler" output.
For now, the profiler output automatically stops on target destruction and will open the profiler result.

By having an option to record on next page load, it prevent starting the tracer and prevent logging traces
for the current WindowGlobal. It should help focus on the new document.
For the profiler output, it prevents having the profiler to show up for the previous WindowGlobal.

Ensure updating the tracing state from the TracerCommand,
so that its internal state is correct whenever we start tracing
via the console or debugger.

Assignee: nobody → poirot.alex

This simplifies toggling the Tracer on all active targets.
But this will be especially useful in the next changeset.
This allows to have two distinct level of enabling:

  • the target configuration
  • the actual start of tracing done by the tracer (on user interaction or next page load)

Doing this allows to distinguish tracer simple enabling,
when "trace on next user interaction" is enabled,
where we can display a badge on the tracer icon to significate it isn't tracing just yet.
And actual start of the tracer, when the first user interaction happens,
where we can remove the badge.

Pushed by
[devtools] Synchronize tracer state between console and debugger. r=devtools-reviewers,nchevobbe
[devtools] Use a SessionData/Target configuration to control JavaScript tracer. r=devtools-reviewers,nchevobbe
[devtools] Introduce an option to start tracing on next page load. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
[devtools] Use tracing icon for all messages related to the tracing. r=devtools-reviewers,nchevobbe
You need to log in before you can comment on or make changes to this bug.