Skip to content

Specify rate limiter for navigation, history traversal, and pushState/replaceState#12492

Merged
zcorpan merged 6 commits into
mainfrom
zcorpan/navigation-limit-noop
Jun 16, 2026
Merged

Specify rate limiter for navigation, history traversal, and pushState/replaceState#12492
zcorpan merged 6 commits into
mainfrom
zcorpan/navigation-limit-noop

Conversation

@zcorpan

@zcorpan zcorpan commented May 27, 2026

Copy link
Copy Markdown
Member

This returns instead of throws for web compat.

Fixes #11108. Fixes #11410.

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


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

…/replaceState

This returns instead of throws for web compat.

Fixes #11108. Fixes #11410.
@zcorpan zcorpan force-pushed the zcorpan/navigation-limit-noop branch from 0238d1a to f5dda35 Compare May 27, 2026 10:19
Comment thread source Outdated
@farre

farre commented May 27, 2026

Copy link
Copy Markdown
Contributor

This looks pretty much like how I envisioned. The only thing I'm not entirely sure about about is how this affects step 11 of #navigate. i.e the fact that we'll call #stop-intersection-observing-a-lazy-loading-element, and then just return. Maybe that's fine, but I think someone else needs to say so. Otherwise this LGTM.

@zcorpan

zcorpan commented May 27, 2026

Copy link
Copy Markdown
Member Author

Yes I put it there to match Chromium's order.

To notice a difference, you would need to do something like call pushState 199 times on a lazy iframe (before it has navigated to its src), then navigate it with location.href (which hits the rate limit), then wait to reset the counter, then make the iframe visible. (Assuming the limit is 200.)

I think it makes some sense that if code attempts to navigate a lazy iframe, it aborts the lazy load, even if the navigation was rate-limited.

Comment thread source Outdated
Comment thread source Outdated
@zcorpan zcorpan merged commit c656649 into main Jun 16, 2026
2 checks passed
@zcorpan zcorpan deleted the zcorpan/navigation-limit-noop branch June 16, 2026 13:22
zcorpan added a commit to web-platform-tests/wpt that referenced this pull request Jun 16, 2026
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.

Repeated navigations with location.hash etc should throw History API: PushState can silently fail in Chromium while Gecko/Webkit raises exception

3 participants