In this example it simply reloads the page, but can replace reload with anything
window.onpageshow = event => {
if (event.persisted) {
console.log("Page reopened from bfcache");
location.reload();
}
}
Modified on: Mon, 16 Feb, 2026 at 12:25 PM
In this example it simply reloads the page, but can replace reload with anything
window.onpageshow = event => {
if (event.persisted) {
console.log("Page reopened from bfcache");
location.reload();
}
}
Did you find it helpful? Yes No
Send feedback