Skip to content

Instantly share code, notes, and snippets.

@voku
Created January 7, 2016 15:08
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voku/854fef3b9a3fbf10624f to your computer and use it in GitHub Desktop.
Save voku/854fef3b9a3fbf10624f to your computer and use it in GitHub Desktop.
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