Last active
June 21, 2019 10:27
-
-
Save jerinisready/c4cc1547c45989c18a97b581f9b500c6 to your computer and use it in GitHub Desktop.
Reload page if a browser-cached version is loaded! ie; via back or forward buttons... https://stackoverflow.com/a/43043658/6419332
This file contains 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
<script> | |
/** Credits: https://stackoverflow.com/a/43043658/6419332 */ | |
window.addEventListener( "pageshow", function ( event ) { | |
var historyTraversal = event.persisted ||( typeof window.performance != "undefined" && | |
window.performance.navigation.type === 2 ); | |
if ( historyTraversal ) {window.location.reload();} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment