Search code examples
javascriptjquerybrowser-historypage-refresh

Chrome 41: Force Reload when pressing the back button


I'm trying something similar to this: Force reload/refresh when pressing the back button

Unfortunately, the suggested code doesn't work in Chrome 41:

window.onpageshow = function(evt) {
// If persisted then it is in the page cache, force a reload of the page.
if (evt.persisted) {
    document.body.style.display = "none";
    location.reload();
}};

Is there a newer solution to this problem?

Thanks a lot!


Solution

  • Please check this question that addresses the problem using localStorage/sessionStorage.