Closed Bug 1827850 Opened 3 years ago Closed 3 years ago

Can't break on DOM mutations on UA widgets.

Categories

(DevTools :: Debugger, defect)

defect

Tracking

(firefox114 fixed)

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(2 files, 1 obsolete file)

STR:

  • Apply the attached patch.
  • Set devtools.inspector.showAllAnonymousContent=true.
  • Open data:text/html,<video controls>.
  • Inspect the Play / Pause button, set an attribute modification breakpoint, and click it.

ER:

  • Breakpoint gets triggered.

AR:

  • The window isn't paused.

A bit of debugging indicates that getNewFrame() is null here, so we bail out.

I think this is because UA widgets run from a separate JS global (the UA widget scope) see here.

Depends on: 1827854
See Also: → 1827856

On the DevTools side, we control the global registered to the Debugger API over there:
https://searchfox.org/mozilla-central/rev/ad732108b073742d7324f998c085f459674a6846/devtools/server/actors/targets/window-global.js#290-295
windows will typicaly be only refering the the debugged page window object and only this.

If the DOM mutation is fired by a global that is not registered in the Debugger API, it could easily explain failures.

But if we can get access to such distinct global, we could probably add it to the list of globals returned by findDebuggees.
And/or, if this global is created after devtools are opened, we might need to tweak _shouldAddNewGlobalAsDebuggee to accept this special global. (this function is called for all new globals created in the same process)
We already try to accept webextension content script sandboxes.

This does the trick! Do you know how to possibly test this?

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Blocks: 1827516
Attachment #9328889 - Attachment is obsolete: true
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/90845ef53f67 Include UA widget scope in findDebuggees. r=ochameau,devtools-reviewers
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: