Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
reload on history-back with "history.pushState" usage
/**
* reload on history-back with "history.pushState" usage
*
* Necessary hack because WebKit fires a popstate event on document load
* https://code.google.com/p/chromium/issues/detail?id=63040
* https://bugs.webkit.org/process_bug.cgi
*/
$(window).bind('load', function() {
if (Modernizr.history) {
setTimeout(function() {
$(window).bind('popstate', function() {
location.reload();
});
}, 0);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment