Skip to content

Conversation

@byteforge38
Copy link
Contributor

@byteforge38 byteforge38 commented Jan 12, 2026

The "navigate to a javascript: URL" algorithm now receives the navigationId from the navigate algorithm and checks if the ongoing navigation is still the same before proceeding. This ensures that javascript: URL navigations do not interfere with other navigations that may have started in the meantime (e.g., form submissions).

Fixes #12075.


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


/browsing-the-web.html ( diff )

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

I think this works, thanks! This is already implemented by all browsers, right?

cc @josepharhar

@byteforge38
Copy link
Contributor Author

@annevk Thanks for reviewing and approving my PR. The Participation CI check asks me to get verified. Could you please verify me so that it can succeed?

@annevk annevk merged commit 976d272 into whatwg:main Jan 15, 2026
2 checks passed
@josepharhar
Copy link
Contributor

This ensures that javascript: URL navigations do not interfere with other navigations that may have started in the meantime (e.g., form submissions).

The commit message which I added this test in suggests that form submissions cancel pending js url navigations rather than js url navigations checking if there is any other pending navigation and canceling itself, but I also don't know what a navigation id is 😅

@annevk
Copy link
Member

annevk commented Jan 16, 2026

This accomplishes that:

  1. You navigate to a JS URL. This sets the current navigation ID (let's say to JSURL) and queues a task passing on JSURL.
  2. You navigate a form. This sets the current navigation ID to FORM and queues its own task.
  3. The JS URL task now runs. It looks at the current navigation ID to see if it's still JSURL. It's not, so it returns early.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

javascript URL navigations do not check ongoing navigation status

4 participants