Expose replace bit in "browsing-context-attached" notification
Categories
(Core :: DOM: Navigation, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox97 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
Details
(Whiteboard: [bidi-m3-mvp])
Attachments
(1 file)
Similar to browsing-context-discarded
it would be helpful to have a replace
bit for the browsing-context-attached
notification. That would help to indicate if the new browsing context is based on a newly opened tab or attached iframe, or just triggered by a browsing context group switch.
Related code for browsing-context-discarded
can be found here:
https://searchfox.org/mozilla-central/rev/667224045f6e624ac4e730171c75c21945f1b336/docshell/base/BrowsingContext.cpp#907-916
Assignee | ||
Comment 1•3 years ago
|
||
Nika, which kind of check would be necessary here in the C++ code so that we could set this flag? Thanks!
Comment 2•3 years ago
|
||
It's not super elegant, but we can probably get away with using whether or not we need to create a new mWebProgress
when attaching (https://searchfox.org/mozilla-central/rev/125116c312b0a9c438d44e16011b116950caf17e/docshell/base/BrowsingContext.cpp#800-804) to determine if it's a fresh BrowsingContext, or replacing an existing one.
The logic would need to be that by-default it's a non-replacing load, but if XRE_IsParentProcess() && IsTop() && IsContent() && Canonical()->mWebProgress
before the member is ensured to be initialized, then the BC is being created as a replacement for an existing BC.
Comment 3•3 years ago
|
||
(In reply to Nika Layzell [:nika] (ni? for response) from comment #2)
It's not super elegant, but we can probably get away with using whether or not we need to create a new
mWebProgress
when attaching (https://searchfox.org/mozilla-central/rev/125116c312b0a9c438d44e16011b116950caf17e/docshell/base/BrowsingContext.cpp#800-804) to determine if it's a fresh BrowsingContext, or replacing an existing one.The logic would need to be that by-default it's a non-replacing load, but if
XRE_IsParentProcess() && IsTop() && IsContent() && Canonical()->mWebProgress
before the member is ensured to be initialized, then the BC is being created as a replacement for an existing BC.
Nika, are you suggesting that we close this bug as WONTFIX because callers can use this workaround to determine whether a BrowsingContext is new or replaced? Or were you sketching how BrowsingContext might implement this new API?
Assignee | ||
Comment 4•3 years ago
|
||
Chris, we need this information from JS code and as chatted with Nika end of last week this is a proposal in how to get the information included within the browsing-context-attached
notification.
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
I'm going to take that bug given that we need it for WebDriver BiDi milestone 3.
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Comment 8•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Description
•