Skip to content

Conversation

@noamr
Copy link
Collaborator

@noamr noamr commented Nov 19, 2025

Deferred same-origin cross-document commit

This gives a way for authors to defer a same-origin cross-document navigation commit.

It exposes:

  • navigateEvent.deferCommit(promise)

Defers a cross-document same-origin commit, without intercepting it.
Returns a promise that can be used to clean up any intermediate state.

  • navigateEvent.destination.ready

A boolean getter that returns true when the navigation is expected to be instant, i.e.
when the destination already has a document and that document is not render-blocked
(which by and large would imply prerendering).

Closes #11819

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs:
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


/browsing-the-web.html ( diff )
/nav-history-apis.html ( diff )

This specifies a way for authors to defer a same-origin cross-document navigation
commit.

It exposes:
- `navigateEvent.deferCommit(promise)`

Allows a listener to the `navigate` event to defer a cross-document commit, without intercepting it.
Returns a promise that can be used to clean up any intermediate state.

- `navigateEvent.destination.ready`

A boolean getter that returns true when the navigation is expected to be instant, i.e.
when the destination already has a document and that document is not render-blocked
(which by and large would imply prerendering).

Closes whatwg#11819
@noamr noamr marked this pull request as draft November 19, 2025 15:46
@noamr noamr changed the title Defer Deferring same-origin cross-document commit Nov 19, 2025
@noamr noamr changed the title Deferring same-origin cross-document commit Allow deferring same-origin cross-document commit Nov 20, 2025
@noamr noamr marked this pull request as ready for review November 20, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Allow deferring commit of a same-origin cross-document navigation

1 participant