delayed-scroll-restoration-polyfill icon indicating copy to clipboard operation
delayed-scroll-restoration-polyfill copied to clipboard

Navigating back performs full page refresh in Chrome iOS

Open richardscarrott opened this issue 6 years ago • 0 comments

  1. Visit the below html page in Chrome on iOS
  2. Dismiss the "Script evaluated" alert
  3. Click the "Go to another page" button
  4. Click the "Go back" button

Expect: Page to navigate back without a reload Actual: Page reloads, as evidenced by the second "script evaluated" alert box

<!DOCTYPE html>
<html>
  <head>
    <script src="https://unpkg.com/[email protected]/index.js"></script>
  </head>
  <body>
    <button class="another-page-btn">
      Go to another page
    </button>
    <button class="back-btn">
      Go back
    </button>
    <script>
      alert("Script evaluated");
      document
        .querySelector(".another-page-btn")
        .addEventListener("click", e => {
          window.history.pushState(null, "Another page", "/another-page");
        });
      document.querySelector(".back-btn").addEventListener("click", e => {
        window.history.back();
      });
    </script>
  </body>
</html>

richardscarrott avatar Nov 04 '19 18:11 richardscarrott