Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
Using History API to maintain state in Google Maps across browser engines for WordPress site

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.

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!