delayed-scroll-restoration-polyfill
delayed-scroll-restoration-polyfill copied to clipboard
Navigating back performs full page refresh in Chrome iOS
- Visit the below html page in Chrome on iOS
- Dismiss the "Script evaluated" alert
- Click the "Go to another page" button
- 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>