Disable backward and forward button using javascript

I was facing the same problem and searching for a solution. I got no exact solution, so i wrote my own code.

STEP 1: Before writing the code i analyzed what the browser shortcuts for moving through the history. The shortcuts of different browsers to move through the history are :

given in format keyboard shortcuts (its key value)

Mozilla Firefox

Backspace (8) – 1 page back throught the history

Alt + left arrow (37) – 1 page back through the history

Alt + right arrow (39) – 1 page forward through the history

Shift + Backspace (8) – 1 page forward through the history

Continue reading