When navigating back to a long page using `history.back()` or `history.go(-1)` the browser returns to the page and resets the scroll position to `0`. However, performing the same navigation using the browser's "back" button restores the scroll position on the previous page. I would expect `history.back()` to behave the same as clicking the back button and restore the previous page's scroll position.
Do you have an example of a page that shows this bug?
<rdar://problem/116408614>
Ah, I put together a demo and found an explanation. My link markup looked like this: `<a href="/previous" onclick="history.back()">Back</a>` I realized `back()` is asynchronous so the `href` is being followed as though the link were clicked. If I change the `onclick` to `event.preventDefault();history.back()` things work as I would expect. I was thrown off because `onclick="history.back()"` works in FireFox without needing the `preventDefault()`. I think this report can be closed. Thanks for letting me rubber duck this issue.
Thank you for checking.