Open Bug 1826389 Opened 1 year ago Updated 1 year ago

Allow starting javascript tracing via an chrome-only API on console object

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Bug 1817834 will introduce a chrome only way to toggle JavaScript tracing.
But this is still tedious as it requires the following code to toggle it:

const {
  startTracing,
  stopTracing,
} = ChromeUtils.import("resource://devtools/server/tracer/tracer.jsm");
startTracing({ prefix: "myPrefix" });
[... run some code...]
stopTracing();

Exposing it on console via console.jsTrace() and console.jsTraceEnd() methods (or similar) sounds like an ideal location for such debugging API.
An incremental improvement would be to expose a ChromeOnly API easily available from all chrome globals and later expose it to all pages via bug 1827616.

For now, you could only toggle tracing from the debugger interface.
Having an API would help debugging tests and start'n stop tracing
from precise locations.
This would also ease passing parameters to have configurable traces.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Attachment #9326931 - Attachment description: Bug 1817834 - [devtools] Allow to start and stop JavaScript tracing via console.jsTrace() and console.jsTraceEnd(). → Bug 1826389 - [devtools] Allow to start and stop JavaScript tracing via console.jsTrace() and console.jsTraceEnd().
Blocks: 1827611
Blocks: 1803616
Summary: Allow starting javascript tracing via an API from web pages → Allow starting javascript tracing via an chrome-only API on console object
Blocks: 1827616
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: