Skip to content

Navigation API #34

Closed
Closed

Description

@robwormald

Request for position on an emerging web specification

  • WebKittens who can provide input:

Information about the spec

Design reviews and vendor positions

Bugs tracking this feature

  • WebKit Bugzilla:
  • Radar:

Anything else we need to know

Linked explainers explain it well.

From a developer point of view this is a massive leap forward over the existing, kludgy solutions for routing / navigation interception. This is a difficult API to polyfill correctly, but a positive signal from WebKit would allow us to at least know there's a better future on the way.

From a framework implementer point of view, the biggest win with this API would allow us to properly centralize route handling, and perhaps begin to share / reuse more framework agnostic routing mechanisms. Most frameworks today must intercept anchor click events and effectively spoof navigation behavior, and this behavior is generally not compatible across various implementations, and requires a fair bit of (often brittle) code.

Angular : https://github.com/angular/angular/blob/main/packages/router/src/directives/router_link.ts#L396-L415
Vue: https://github.com/vuejs/router/blob/main/packages/router/src/RouterLink.ts#L138-L301
Remix: https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/index.tsx#L270-L301

Activity

  1. added
    venue: WICG
    on Jul 15, 2022
  2. domenic commented on Jul 27, 2022

    @domenic

    FYI the plan is to merge this into HTML; given Mozilla's support that work is mostly blocked on finishing whatwg/html#6315 first.

  3. added
    topic: html
    on Aug 24, 2022
  4. added
    from: Google
    on Sep 25, 2022
  5. bkardell commented on Mar 15, 2023

    @bkardell
    Collaborator

    It seems worth noting that whatwg/html#6315 mentioned by @domenic merged on Halloween 2022 and whatwg/html#8502 was created since and what to look at now?

  6. annevk commented on Mar 15, 2023

    @annevk
    Contributor

    Thank you for mentioning that @bkardell, that is indeed unclear. What we all need to review is whatwg/html#8502 which is rendered at https://whatpr.org/html/8502/nav-history-apis.html#navigation-api. (Both are linked from https://wicg.github.io/navigation-api/ but that was not linked from OP until I edited it just now.)

  7. domenic commented on Mar 23, 2023

    @domenic

    Hi folks, is there anything else I can do to help get WebKit's position on this API? Apart from the lack of clarity on multi-implementer interest, the spec PR is about ready to land, having gone through a few rounds of review.

  8. moved this from Unscreened to Needs position in Standards Positions Review Backlogon Mar 23, 2023
  9. moved this from Needs position to Needs assignees in Standards Positions Review Backlogon Mar 27, 2023
  10. moved this from Needs assignees to Needs position in Standards Positions Review Backlogon Mar 27, 2023
  11. rd3k commented on May 22, 2023

    @rd3k

    Is this blocked on anything in particular or just queued?

  12. lukewarlow commented on Jun 26, 2023

    @lukewarlow
    Member
  13. annevk commented on Oct 4, 2023

    @annevk
    Contributor

    Colleagues and I discussed this and as a result would like to mark this as "position: support" one week from now.

    One unresolved question: why is it navigate(), but traverseTo()? Instead of navigateTo() & traverseTo() or navigate() & traverse().

  14. moved this from Needs position to Position identified in Standards Positions Review Backlogon Oct 4, 2023
  15. domenic commented on Oct 10, 2023

    @domenic

    One unresolved question: why is it navigate(), but traverseTo()? Instead of navigateTo() & traverseTo() or navigate() & traverse().

    We chose traverseTo() instead of traverse() to indicate that, unlike history.go(), it's specifically going to a target passed as the argument, instead of moving by an offset.

    We honestly weren't comparing navigate() and traverseTo() with each other much, and I can see how it's a bit strange when you look at them side-by-side. I tend to split the API mentally though: back(), forward(), traverseTo() in one corner, and navigate() in another.

    Maybe another way of looking at it is, navigate(x) and navigateTo(x) should mean the same thing, so we pick the shorter/simpler one. Whereas traverse(x) and traverseTo(x) could arguably mean different things.

    I hope this helps!

  16. marked Navigation Activation #282 as a duplicate of this issue on Aug 18, 2025
  17. DennysDionigi commented on Oct 29, 2025

    @DennysDionigi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

from: Googleposition: supporttopic: htmltopic: loadingvenue: WHATWG HTML Workstreamvenue: WICG

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions