This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
The scrollRestoration property of the History interface allows web applications to explicitly set default scroll restoration behavior on history navigation.
One of the following:
autoThe location on the page to which the user has scrolled will be restored.
manualThe location on the page is not restored. The user will have to scroll to the location manually.
const scrollRestoration = history.scrollRestoration;
if (scrollRestoration === "manual") {
console.log(
"The location on the page is not restored, user will need to scroll manually.",
);
}
history.scrollRestoration = "manual";
| Specification |
|---|
| HTML> # dom-history-scroll-restoration-dev> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
scrollRestoration |
46 | 79 | 46 | 33 | 11 | 46 | 46 | 33 | 11 | 5.0 | 46 | 11 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration