[JavaScript] How to disable Web browser back button.

The following link is sample source code to disable Web browser back button.
https://jsfiddle.net/saimjcf/we96kv4x/10/

Push “RUN” button, and JavaScript will be load.
Then push browser back button to check behavior. You can see browser back button does not work.

It works with the following code in sample source.

At first, push new history (=itself) to browser history. So, If push browser back button, back to itself.

#Checked only in Google Chrome and Firefox.