Only use gDevTools.showToolboxForTab or gDevTools.showToolboxForWebExtension to open toolboxes
Categories
(DevTools :: Framework, task)
Tracking
(firefox110 fixed)
Tracking | Status | |
---|---|---|
firefox110 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
We should reduce the manual instantiation of "commands" when the goal is to display a related toolbox.
Once we move the toolbox to a privileged process, we will no longer spawn the commands object from the parent process.
In order to ease achieving this goal, we should reduce the number of calls to gDevTools.showToolbox(commands, ...)
.
In theory this should only be called in these five cases:
- for debugging a local tab, and
gDevTools.showToolboxForTab
should be used instead. - for debugging a web extension (in a independant always-on-top window) and
gDevTools.showToolboxForWebExtension
should be used instead. - for the browser toolbox
https://searchfox.org/mozilla-central/rev/8fd39dc89c68501a354446a8681ec8263d15e5aa/devtools/client/framework/browser-toolbox/window.js#227
It would be relevant to create a method on gDevTools so that showToolbox becomes a private of it. - from toolbox-init, for all about:debugging toolboxes opened in tabs (This code will become the default codepath for all the toolboxes once we move to a privileged process)
https://searchfox.org/mozilla-central/rev/8fd39dc89c68501a354446a8681ec8263d15e5aa/devtools/client/framework/toolbox-init.js#118
Bug 1807904 will try to remove this callsite and instead manually instantiate the Toolbox object.
But in practice we still have exotic calls of showToolbox in tests, where we are going through codepath that aren't possible in production. Like showing a toolbox for a worker in a WINDOW host. Or showing the storage panel for web extension in a non WINDOW host.
Assignee | ||
Comment 1•2 years ago
|
||
Let this test use the same codepath as production codepath used by about:debugging.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
This test was opening a toolbox via gDevTools.showToolbox for a worker descriptor.
This doesn't reflect anything done in production.
about:debugging will open a about:devtools-toolbox?type=worker&id=${workerId}
URL
in a firefox tab. This wouldn't use any Toolbox Host other than "PAGE" one.
Assignee | ||
Comment 3•2 years ago
|
||
Note that showToolbox already takes care of reusing existing toolbox if you pass the same tab element.
Otherwise let's try to stick to method used in production.
When debugging a local tab, we are using showToolboxForTab.
When debugging an addon, about:debugging calls showToolboxForWebExtension.
Also cleanup some legacy in the webext test.
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/67778f0ba40e
https://hg.mozilla.org/mozilla-central/rev/5cce361c59f6
https://hg.mozilla.org/mozilla-central/rev/48ca857f942d
Description
•