← Back to release summary

Navigation API

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

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

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