← Back to release summary

Navigation API: add post-commit handler from precommit

Category
DOM
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

Currently when intercepting navigations with the `navigate` event, precommitHandlers and post-commit ordinary handlers are passed separately. This works well when there is only one or the other, but can be a bit clunky when the flow includes a precommitHandler that leads to a post-commit handler. This addition is a small ergonomic improvement that enables registering a post-commit handler while invoking a precommit handler.

Motivation

This is a small ergonomic fix to the API enabling a bit more flexibility.

Standards & signals

Explainers: https://github.com/WICG/navigation-api/pull/294

View on chromestatus.com