← Back to release summary

Navigation API

Category
Miscellaneous
Type
New or changed feature
Status
Enabled by default (Chrome 102)
Intent stage
Prepare to ship

WPT details: https://wpt.fyi/results/navigation-api?label=master&label=experimental&aligned These results show a strange number of failures for Chromium. We suspect this is due to the test runner on wpt.fyi as running the tests locally or in a live Chrome browser do not exhibit the issue. See https://github.com/web-platform-tests/wpt/issues/33590

Summary

The window.navigation API provides the ability to intercept and initiate navigations, as well as introspect an application's history entries. This provides a more useful alternative to window.history and window.location, specifically aimed at the needs of single-page web applications. (Note: this API was formerly known as the app history API.)

Motivation

The existing window.history API is hard to deal with in practice, especially for single-page applications. In the best case, developers can work around this with various hacks. In the worst case, it causes user-facing pain in the form of lost state and broken back buttons, or the inability to achieve the desired navigation flow for a web app.

Standards & signals

Ecosystem

Docs: https://developer.chrome.com/docs/web-platform/navigation-api

Samples: https://gigantic-honored-octagon.glitch.me/ https://selective-heliotrope-dumpling.glitch.me/

Explainers: https://github.com/WICG/navigation-api/blob/main/README.md

View on chromestatus.com