← Back to release summary

Removal of navigateEvent.restoreScroll()

Category
Miscellaneous
Type
Feature removal
Status
Removed (Chrome 108)
Intent stage
Prepare to ship

Summary

restoreScroll() is being replaced by navigateEvent.scroll(). scroll() works identically except that it allows the developer to control scroll timing for non-traverse navigations (i.e., scroll() works when the scroll is not a restore, hence the name change along with the behavior change).

Motivation

We want to support developer-controlled timing of a navigation-associated scroll in non-traverse cases (e.g., scrolling to a fragment). It makes sense to have the same fragment drive navigation-related scrolling in both traverse and non-traverse cases, but the name "restoreScroll" is nonsense for push/replace navigations.

Standards & signals

View on chromestatus.com