Closed Bug 1899558 Opened 1 year ago Closed 11 months ago

Provide a console tool to easily search the page including the shadow roots

Categories

(DevTools :: Console, enhancement, P2)

enhancement

Tracking

(firefox135 fixed)

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: julienw, Assigned: nchevobbe, Mentored)

Details

Attachments

(1 file)

Currently looking into shadow roots isn't straightforward from the Web Console. It should be easier.

$$$ would be cool. If not supported via a secret chrome-only API, it can be implemented in js, but this needs manually looping on the elements to find the shadow root, and then recurse inside the shadow dom.

Could be useful to end users and firefox engineers.
Nicolas is offering to mentor this one, not an easy bug but should be doable with guidance.

Mentor: nchevobbe
Priority: -- → P2

To register a new console command, you can copy the existing implementation of $$:
https://searchfox.org/mozilla-central/rev/55837bbe3e47f9b4fa91ef83a44b53823626f01d/devtools/server/actors/webconsole/commands/manager.js#471-509
and you should get a new console command working out of the box.

This is based on $$ but extends it so it also look for potential matches in
the shadow DOM, recursively.
A test is added, as well as some documentation for the helper.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2cb05ca2fa39 [devtools] Add $$$ console utility to also search for elements in shadow roots. r=devtools-reviewers,jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: