I have implemented the following JavaScript code on my client's website to manage a back one page link that is displayed in the header of single pages. When the link is clicked, the user is taken back one page in the browser's history.
<a href="https://callkneehill.ca/" class="button button--previous js-button--previous">
Back
</a>
<script>
const previousButton = document.querySelector(".js-button--previous");
previousButton.addEventListener("click", function(e) {
e.preventDefault();
window.history.back();
}, false);
</script>
When a user visits a Google Maps page and navigates to a single page using the ink displayed in the info window, then clicks the pink background back link in the header, the session state (?) for the map (info window displayed, custom zoom level set) is maintained in Webkit-based browsers on iOS and macOS. However, the state is not maintained in Chromium-based or Firefox browsers.
Is this the expected behaviour for Webkit or the other browsers? I have been reading about the History API, but have not found an example that covers why one browser engine maintains the state on Google Maps, while the others do not.
Any insights or tips are greatly appreciated.