Open Bug 1892411 Opened 7 months ago Updated 5 months ago

Debugger doesn't break in late breakpoint for destroyed iframes

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: ochameau, Assigned: ochameau)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

Nicolas highlighted various cases of breakpoints being not functional when setting them on late event fired while the iframe is being destroyed.
See bug 1887852 comment 5.

STR:

None of them are pausing the debugger, while these listeners actually run.

The docshell should be observed only when "EveryFrameTarget" is off for the WindowGlobal Target Actor.
i.e. when followWindowGlobalLifeCycle is false and the target actor manages more than one WindowGlobal.

This docshell observing was destroying the target actor too early and was redundant with the code
managing WindowGlobal target actor lifecycle in the WindowGlobal Target Watcher class.

Also, in WindowGlobalTargetActor.window getter, we shouldn't ignore docshell that are being destroyed,
they are still valid when hitting a late breakpoint.

Severity: -- → S3
Priority: -- → P2

The innerWindowId is used as an identifier for frame targets.
It ought to be unique and stable for a given target actor as this is used
in Resource forms as identifier for targets.

Also, getting a live getter may throw when accessing the window object's innerWindowId
when the document starts being destroyed (on iframe unload), but there is still relevant debugging
to be done against the WindowGlobal.

The checks in WindowGlobal Target Watchers were brittle as they were relying on the fact that
the WindowGlobalTargetActor's innerWindowId would be updated to the new WindowGlobal ID
when the BrowsingContext navigated to a new document. The findTargetActor method now uses
BrowsingContext ID to lookup for any existing Target Actor for the current BrowsingContext.
(this still uses WG innerWindowId for WG destruction codepath)

See Also: → 1898490
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Depends on: 1903980

Comment on attachment 9398388 [details]
Bug 1892411 - [devtools] Use a fixed innerWindowId for WindowGlobal Target Actor.

Revision D208497 was moved to bug 1903980. Setting attachment 9398388 [details] to obsolete.

Attachment #9398388 - Attachment is obsolete: true

Comment on attachment 9397535 [details]
Bug 1892411 - [devtools] Only observe children docshell in browser toolbox and web extension targets.

Revision D207801 was moved to bug 1903980. Setting attachment 9397535 [details] to obsolete.

Attachment #9397535 - Attachment is obsolete: true

The webnavigation-destroy / DocShell destruction was too early as it fired before the iframe unload listener are fired.

See Also: 1898490
Depends on: 1904788
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: