Navigation precommit handlersLimited availability
The precommitHandler callback option to NavigateEvent's intercept() method returns a promise that defers navigation until the promise resolves. You can use this to change the navigation's URL, state, and history before navigation occurs.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–145Not supported
146+Supportedsince Mar 10, 2026
Current: 155Edge
12–145Not supported
146+Supportedsince Mar 13, 2026
Current: 154Firefox
1–147Not supported
148+Supportedsince Feb 24, 2026
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–145Not supported
146+Supportedsince Mar 10, 2026
Current: 155Firefox Android
4–147Not supported
148+Supportedsince Feb 24, 2026
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Safari, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: NavigationPrecommitController.
Feature detection
JS · check before using
if ("NavigationPrecommitController" in globalThis && "addHandler" in NavigationPrecommitController.prototype) {
// NavigationPrecommitController.addHandler is available
}Documentation (MDN)
Sub-features
Support for each part of the feature (4). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| NavigateEvent.intercept.precommitHandler_option | 141 | 141 | 147 | ✕ | 141 | 147 | ✕ |
| NavigationPrecommitController | 141 | 141 | 147 | ✕ | 141 | 147 | ✕ |
| NavigationPrecommitController.addHandler | 146 | 146 | 148 | ✕ | 146 | 148 | ✕ |
| NavigationPrecommitController.redirect | 141 | 141 | 147 | ✕ | 141 | 147 | ✕ |