Last active
August 29, 2015 14:26
-
-
Save chekit/a3459fb91e624c3e246a to your computer and use it in GitHub Desktop.
Disable Back button on Browser and Android Hardware
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
(function (w) { | |
'use strict'; | |
w.location.hash = "no-back-button"; | |
w.location.hash = "Again-No-back-button";//again because google chrome don't insert first hash into history | |
w.onhashchange = function(){ | |
w.location.hash = "no-back-button"; | |
} | |
})(window); | |
//Original: http://stackoverflow.com/a/20896928 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add closure and
'use strict'