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

Navigation API (formerly app history API) #717

Closed
1 task done
domenic opened this issue Mar 8, 2022 · 7 comments
Closed
1 task done

Navigation API (formerly app history API) #717

domenic opened this issue Mar 8, 2022 · 7 comments
Assignees
Labels
chromium-high-priority Something that the Chromium team would like the TAG to prioritise privacy-tracker Group bringing to attention of Privacy, or tracked by the Privacy Group but not needing response. Progress: review complete Resolution: satisfied The TAG is satisfied with this design Venue: WHATWG Venue: WICG

Comments

@domenic
Copy link
Member

domenic commented Mar 8, 2022

Braw mornin' TAG!

I'm requesting a TAG review of the proposed navigation API.

The web's existing history API is problematic for a number of reasons, which makes it hard to use for web applications. This proposal introduces a new API encompassing navigation and history traversal, which is more directly usable by web application developers. Its scope is: initiating navigations, intercepting navigations, and history introspection and mutation.

This new window.navigation API layers on top of the existing API and specification infrastructure, with well-defined interaction points. The main differences are that it is scoped to the current origin and frame, it has a different flow for implementing single-page app navigations, and it is designed to be pleasant to use instead of being a historical accident with many sharp edges.

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: we are hoping to send out an Intent to Ship before April 14, 2022
  • The group where the work on this specification is currently being done: WICG
  • The group where standardization of this work is intended to be done (if current group is a community group or other incubation venue): WHATWG (HTML Standard)
  • Major unresolved issues with or opposition to this specification: no major issues. Some minor issues in https://github.com/WICG/navigation-api/milestone/1 which I am setting up a working session with Mozilla to nail down.
  • This work is being funded by: Google

You should also know that...

This was previously reviewed in #605. Based on TAG and Mozilla feedback, we had a renaming discussion in WICG/navigation-api#83 which led to the new "navigation API" (and window.navigation) name.

We'd prefer the TAG provide feedback as (please delete all but the desired option):

🐛 open issues in our GitHub repo for each point of feedback

@hadleybeeman
Copy link
Member

Linking to our previous review on App history API

@chrishtr chrishtr added the chromium-high-priority Something that the Chromium team would like the TAG to prioritise label Apr 14, 2022
@torgo torgo modified the milestones: 2022-05-23-week, 2022-06-06-week Jun 4, 2022
@domenic
Copy link
Member Author

domenic commented Jun 13, 2022

Just leaving a quick note here about an upcoming breaking change we're making. I don't think it needs a separate TAG review but it might be interesting for the group: WICG/navigation-api#235

@torgo torgo added Venue: WICG Venue: WHATWG privacy-tracker Group bringing to attention of Privacy, or tracked by the Privacy Group but not needing response. labels Jun 22, 2022
@torgo
Copy link
Member

torgo commented Jun 22, 2022

Hi Domenic - sorry this took so long. We've been reviewing and have had the chance to discuss on today's call. Some feedback from that session: In general we're happy with this API. We appreciate the care taken in the security & privacy considations section. One question I had was about how this impacts the behaviour of the back button - it wasn't exactly clear what you mean by "when iframes are involved" here. Can you spell it out a bit more clearly? Is this to do with the iframe's navigation history being integrated with the parent document's history? And what is the changed UI you anticipate? Generally we have positive feedback. This looks like it will be an improvement over the current state of the platform. We're planning to finish the review and close next week.

@torgo torgo added the Progress: propose closing we think it should be closed but are waiting on some feedback or consensus label Jun 22, 2022
@domenic
Copy link
Member Author

domenic commented Jun 22, 2022

Thanks for the feedback, and I'm glad to hear you all feel it's an improvement!

One question I had was about how this impacts the behaviour of the back button - it wasn't exactly clear what you mean by "when iframes are involved" here. Can you spell it out a bit more clearly? Is this to do with the iframe's navigation history being integrated with the parent document's history?

This is spelled out in a bit more detail in https://github.com/WICG/navigation-api/blob/main/README.md#correspondence-with-the-joint-session-history . It is indeed about how the iframe's navigation history is integrated with the parent document's history, and how that makes programs harder to reason about even if it can give a better user experience.

That integration remains true for the back button and thus for the user's experience. It also remains true for the classic history API's history.back(), history.go(), etc.

The new feature of the navigation API is that if you use it, then the developer only has to deal with their own frame's history. I.e. instead of how the classic history API has you traverse through the all-inclusive history entry list, with the navigation API you get separate history entry lists for each frame. The section I linked above has specific examples, including what this means for navigation.back() behaving differently than history.back().

However, implementing the navigation API does not imply any UI changes, or changes in the behavior of the back button.

I hope this helps, and am happy to clarify more. Other relevant sections:

@cynthia
Copy link
Member

cynthia commented Jun 28, 2022

Thanks a lot for the clarification! If the frame is first-party and the content author would like to delegate history down (to the frame) and then back up, how would that work? Obviously this is a bit of an edge case, so mostly asking out of curiosity.

Regardless of an answer to that question, we are very happy to see this proposal move forward.

@domenic
Copy link
Member Author

domenic commented Jun 28, 2022

I'm not sure what you mean by "delegate history"; could you expand on that?

@cynthia
Copy link
Member

cynthia commented Jul 14, 2022

Ah, so the question was how to get the parent document's navigation stack needs to cooperate with a frame's navigation stack - I wasn't sure by looking at the proposal.

That said, we can take this offline as we are happy whether or not that question is answered. Thank you for bringing this to our attention!

@cynthia cynthia closed this as completed Jul 14, 2022
@torgo torgo added the Resolution: satisfied The TAG is satisfied with this design label Jun 27, 2023
@torgo torgo removed this from the 2022-07-11-week milestone Jun 27, 2023
@torgo torgo added Progress: review complete and removed Progress: propose closing we think it should be closed but are waiting on some feedback or consensus labels Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromium-high-priority Something that the Chromium team would like the TAG to prioritise privacy-tracker Group bringing to attention of Privacy, or tracked by the Privacy Group but not needing response. Progress: review complete Resolution: satisfied The TAG is satisfied with this design Venue: WHATWG Venue: WICG
7 participants