Intent to Prototype: Future browsing context group dependency hint

235 views
Skip to first unread message

Kevin McNee

unread,
Apr 10, 2024, 12:23:48 PMApr 10
to blin...@chromium.org

Contact emails

mc...@chromium.org

Explainer

https://github.com/explainers-by-googlers/future-browsing-context-group-dependency-hint

Specification

None yet. The spec changes will be a set of patches to the HTML spec. See the "Specification changes" section of the explainer for details.

Summary

Extends the use of the "opener" rel type to same-window navigations to signal to the browser that the destination page will open a new window and the referring page expects to be able to access it. Some user agents perform browsing context group changes on navigation that aren't strictly necessary for security in order to improve performance. This results in named window reuse not being possible across a back navigation. Annotating an anchor element with "opener" will signal to the user agent that performing a browsing context group change would break a future opener relationship.



Blink component

Blink>Internals>Frames

Motivation

Some browsers perform a browsing context group (BCG) swap on navigations for performance reasons. In certain scenarios (see explainer), this can cause web-facing breakage of named window reuse. A site may intend to create one popup window and then reuse it for subsequent navigations, but the browser will instead create a new tab each time. Currently, intentionally making a site bfcache-ineligible acts as a workaround. It's desirable to have an opt-out mechanism that allows authors of affected web pages to prevent breakage for their users, without excessive performance costs.



Initial public proposal

https://github.com/explainers-by-googlers/future-browsing-context-group-dependency-hint

TAG review

None

TAG review status

Pending

Risks



Interoperability and Compatibility

WebKit wouldn't have to make any changes. They already have the intended behaviour of reusing the existing window, without the use of the proposed annotation, and would be aligned with the spec changes. If Firefox wishes to adopt this behaviour, I wouldn't expect architectural difficulties in doing so. It's a matter of passing a bool through to their isolation logic. Alternatively, it would be fine from a spec perspective if they wish to keep the existing behaviour. The use of an opener rel on a link that targets the same window currently has no effect. There are a small number of pages that do this anyway (see use counter [1]). The only negative effect such pages would experience is a potential unintentional loss of bfcache eligibility. Compared to the lack of clarity from creating a new rel type, this seems worth it. For user agents that don't recognize an "opener" window feature, this could change the window selection to a popup instead of a tab. This wouldn't matter for _self navigations. But in any case, a page could explicitly use the feature "popup=0" to avoid this. [1] https://chromestatus.com/metrics/feature/timeline/popularity/4742



Gecko: No signal

WebKit: No signal

Web developers: Positive (https://issues.chromium.org/issues/40281878) The reporter of the motivating bug has indicated that this proposal would enable their use case without bfcache-ineligibility hacks.

Other signals:

Security

No concerns expected. This is not introducing a new capability. It's a more targeted opt-out mechanism for behaviour that can already be achieved. Also note that the page can only use this to avoid optional BCG changes that aren't needed for security. Notably, it can't be used to avoid COOP enforcement.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Is this feature fully tested by web-platform-tests?

Not yet.

Flag name on chrome://flags

None

Finch feature name

None

Non-finch justification

None

Requires code in //chrome?

False

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5182336170983424

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages