Created
January 7, 2016 15:08
-
-
Save voku/854fef3b9a3fbf10624f to your computer and use it in GitHub Desktop.
reload on history-back with "history.pushState" usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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