Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future browsing context group dependency hint #383

Open
kjmcnee opened this issue Aug 15, 2024 · 4 comments
Open

Future browsing context group dependency hint #383

kjmcnee opened this issue Aug 15, 2024 · 4 comments
Labels
concerns: dependencies Some of this proposal's dependencies are unstable, immature, or lack widespread support. concerns: interoperability This proposal creates interop risk, e.g. due to vagueness from: Google Proposed, edited, or co-edited by Google. venue: none / personal repository The venue for discussion is a GitHub repository not affiliated with a standards body.

Comments

@kjmcnee
Copy link

kjmcnee commented Aug 15, 2024

WebKittens

@annevk

Title of the spec

Future browsing context group dependency hint

URL to the spec

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

URL to the spec's repository

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

Issue Tracker URL

No response

Explainer URL

No response

TAG Design Review URL

w3ctag/design-reviews#979

Mozilla standards-positions issue URL

mozilla/standards-positions#1059

WebKit Bugzilla URL

No response

Radar URL

No response

Description

This proposal 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.

Regarding specification, this proposal would consist of a patch for the html spec. See here for details: https://github.com/explainers-by-googlers/future-browsing-context-group-dependency-hint?tab=readme-ov-file#specification-changes

Note that I put @annevk as the potential reviewer given previous activity on relevant issues such as:
whatwg/html#4198
whatwg/html#313
whatwg/html#5350

Thanks.

@annevk
Copy link
Contributor

annevk commented Aug 20, 2024

I think solving whatwg/html#313 first would be a good first step here. There's no need for that to be implementation-defined. It's just a specification bug that nobody has fixed as-of-yet. Once named targeting has a proper definition, it would be much easier to evaluate any proposed tweaks to it.

(That's a general pattern I would recommend when working on something with swampy underpinnings. Fix the foundation first.)

@annevk annevk added concerns: interoperability This proposal creates interop risk, e.g. due to vagueness venue: none / personal repository The venue for discussion is a GitHub repository not affiliated with a standards body. from: Google Proposed, edited, or co-edited by Google. concerns: dependencies Some of this proposal's dependencies are unstable, immature, or lack widespread support. labels Aug 20, 2024
@kjmcnee
Copy link
Author

kjmcnee commented Aug 21, 2024

Indeed, for this proposal to be meaningful for the spec, the named targeting needs to be scoped to BCGs. See the Specification changes section of the explainer.

However, I don't think fully solving issue 313 is needed here as there are a number of considerations beyond what's relevant to this proposal. This proposal isn't actually changing named targeting; it's changing BCG swaps on navigation.

Supposing the named targeting is scoped to BCGs, are there any concerns with the proposal itself?

@annevk
Copy link
Contributor

annevk commented Aug 22, 2024

Taking a step back, it seems that the problem here is that Chromium started making BCG swaps that are not okay per the specification. Perhaps I misremember, but I thought the idea was that we'd only make BCG swaps for address-bar-driven navigations or when they would not be observable. If the BCG's browsing context set holds more than one entry, you can't really swap for ordinary (clicking a link) navigations.

@kjmcnee
Copy link
Author

kjmcnee commented Aug 22, 2024

Both Chromium and Firefox (see here) perform a swap when there are no other windows in the BCG, at the time of the navigation. This check for other windows was believed (as far as I can tell, I can't speak for the original authors) to make these swaps not observable. As it turns out, there was a case that caused these to be observable, due to the opener relationship not being established until after the navigation which performs the swap.

Note that simply reverting this swap behaviour isn't viable, for the reason mentioned in the Considered alternatives section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concerns: dependencies Some of this proposal's dependencies are unstable, immature, or lack widespread support. concerns: interoperability This proposal creates interop risk, e.g. due to vagueness from: Google Proposed, edited, or co-edited by Google. venue: none / personal repository The venue for discussion is a GitHub repository not affiliated with a standards body.
Projects
None yet
Development

No branches or pull requests

2 participants