-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix same-URL navigation session history handling #6476
Conversation
Closes #6202. Also tidies up the "update the session history with the new page" algorithm more generally, e.g. to be explicit about what session history is being accessed.
The same-URL part LGTM. The javascript: URL part is interesting - in Chrome it's not really treated as a navigation but just as a "document change" (see thread), but maybe the "navigate" function in the spec covers that too? (not sure if the difference matters, but maybe it's important for WICG/navigation-api#63 ?) |
Yeah, the spec's "navigate" seems to cover such a "document change", by navigating semi-directly to a synethetic response. The real question is what should happen to the user- and web-page-visible session history, and from what I can tell from some manual testing, it should be "replace" behavior. That said, we've had other problems with this spec approach not matching implementations, e.g. all of the tagged javascript: URL issues. The most direct is that implementations seem to directly modify the body as a string, but creating a synthetic response means creating the body as bytes and then (in theory) passing it through the whole decoding pipeline; that's #1129. I do think we should keep "navigate" as the entry point for The thread you linked is a pretty interesting one too. I think it's most related in spec land to the ongoing policy container work: #4926; see the latest comment there on #4926 (comment) . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we are coalescing the following two conditions:
- Navigations to the same URL
- Explicit historyHandling=replace navigations
I vaguely remember (perhaps incorrectly) that one reason we decided to keep them separate is because because browsers might copy session history state on the same-URL navigation case, but we didn't have reason to believe that this took place in the explicit historyHandling=replace case? I really don't know, I just wanted to bring it up in case it was any concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, yeah I agree that having "navigate" as an entry point makes sense. Thank you for the links too!
Yes, this is exactly why we kept them separate. That's #6213. I kept the XXX box pointing to #6213, but I think if we end up copying over the state then we'd probably do it as an extra condition inside the "replace" case that checks the URLs against each other at that time. See #6213 (comment). |
Closes #6202. Also tidies up the "update the session history with the new page" algorithm more generally, e.g. to be explicit about what session history is being accessed.
/cc @jakearchibald as this probably conflicts with #6315... sorry about that, but this particular cause was starting to cause some real confusion and I wanted to get it fixed sooner.
/browsing-the-web.html ( diff )