How do some websites prevent us from going back to the previous page?

195 views

Do you know these shady websites that don’t allow you to go back, only after spamming the previous page button, or in some cases, the only option is to close the tab. How can web devs disable basic browser functions like that?

In: 4

4 Answers

Anonymous 0 Comments

The ones that you can bypass by spamming the back button are more primitive. Instead of taking you to the page itself, it takes you to a page that automatically redirects you to the actual page (sometimes with a few layers of this). That way clicking back just sends you to the redirect and then back to where you were. This is fairly trivially defeated by spamming back a few times so it goes back before the browser processes the redirect request.

You are viewing 1 out of 4 answers, click here to view all answers.