Closed Bug 1807937 Opened 2 years ago Closed 2 years ago

Only use gDevTools.showToolboxForTab or gDevTools.showToolboxForWebExtension to open toolboxes

Categories

(DevTools :: Framework, task)

task

Tracking

(firefox110 fixed)

RESOLVED FIXED
110 Branch
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:

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.

Let this test use the same codepath as production codepath used by about:debugging.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

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.

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.

Blocks: 1808574
Blocks: 1808576
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/67778f0ba40e [devtools] Always use gDevTools.showToolboxForWebExtension to open Web extension toolboxes. r=devtools-reviewers,extension-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/5cce361c59f6 [devtools] Remove browser_dbg_worker-window.js. r=devtools-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/48ca857f942d [devtools] Use gDevTools.showToolboxForWebExtension and showToolboxForTab from storage panel tests. r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: