Skip to content

Conversation

@noamr
Copy link
Collaborator

@noamr noamr commented Sep 24, 2025

Add NavigationTransition.to, exposing the current navigate event's destination.

This was not necessary before as navigations were committed synchronously, but with precommit handlers this
exposes information about an ongoing navigation.

The destination is set when the NavigationTransition object is created, and remains stable throughout.

Closes #11690.

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


/nav-history-apis.html ( diff )

@noamr noamr changed the title Navigation transition to Add NavigationTransition.to, exposing the current navigate event's destination Sep 24, 2025
@noamr noamr force-pushed the navigation-transition-to branch from 3336abd to 50e0a20 Compare September 24, 2025 12:15
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was easier than I thought it would be, nice.

source Outdated
<dt><code data-x=""><span data-x="dom-navigation">navigation</span>.<span data-x="dom-Navigation-transition">transition</span>.<span subdfn data-x="dom-NavigationTransition-to">to</span></code></dt>
<dd><p>The <code>NavigationDestination</code> of the transition. This can be useful to compare
against <code data-x="dom-Navigation-currentEntry">navigation.currentEntry</code> before the
navigation is <span data-x="concept-NavigationTransition-committed">committed</span>.</p></dd>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "compare against" makes it sound like === will work, which it will not. I'm not sure what the best rephrasing is...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something along the lines of competing the different properties of the entry and destination

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded a bit

@noamr noamr force-pushed the navigation-transition-to branch from 50e0a20 to 7036eef Compare September 25, 2025 08:27
@noamr
Copy link
Collaborator Author

noamr commented Oct 1, 2025

@zcorpan can I mark it as "two implementers interested"? People said it was reasonable but I want to make sure. If so, I'll open implementation bugs and fill in the rest of the checkboxes.

@zcorpan
Copy link
Member

zcorpan commented Oct 1, 2025

Yes. Thanks!

@noamr
Copy link
Collaborator Author

noamr commented Oct 6, 2025

I think this can be merged.

@noamr
Copy link
Collaborator Author

noamr commented Oct 14, 2025

I think this can be merged.

Ping @zcorpan

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.

Add to or destination to NavigationTransition

4 participants