Disable Browser Back Button

Pardon my JavaScript ignorance, but does that action do pretty much the same thing I suggested doing with a Lectora action (shoving the learner forward) or does it actually disable the Back button? Also, how does putting that script on the page affect what the Back button does? I don't see any reference to the Back button in the script...

Discussion (1)

Hello, I had a problem like this.

In my case, I was programming a game using Lectora, the client used the browser's back button and managed to evade the points system of the game, to solve it I used a small javascript code.

Follow the procedure that I performed to block the browser back button.

Added an action to show the screen runs a javascript code.

history.pushState(null, document.title, location.href);

window.addEventListener('popstate', function (event)

{

history.pushState(null, document.title, location.href);

});

Capturar.jpg

Discussions have been disabled for this post