What keeps the back button from working on some sites?

So, we were all on some annoying websites that disabled the back button in your browser. This can be bypassed by quickly pressing the return button two or three times. My question is: what exactly happens when the "Back" button is disabled and 2.) Why does pressing the button fix the problem two or three times? Dying for the answer, don't let me down, SO! :)

+6
source share
6 answers

This is a redirect - you click on a link to page a , which redirects to page b . When you go back, go back to page a , which instantly redirects you to page b . If you click twice twice, there will be no time for redirection.

I don’t think your question is related to Twitter. There is another problem with buttons with JavaScript applications that do not reload pages when changes to the page are not logged as historical events, so rolling back takes you much further than you expected. But this is a completely unrelated problem.

+7
source

I think you will find a decent answer here ( http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911/Disabling-the-Back-Button.htm ) in Method Three: Trap .

+3
source

Most likely they have an intermediate page with a redirect. Clicking the back button once just returns you to this page and redirects you back to the page you want to return to. By clicking several times, you go to the intermediate page (the first press), then in front of the page (in the second click), etc.

0
source

If you get to a page with meta-redirection to another page, you will find that clicking the "Back" button does not work, because you click "back" to go to the page that redirects you to the page on which you are already located, As a rule, location headers do not make you trapped since the page that sends you is not recorded in most browser logs.

0
source

The page you are trying to return to is redirected, so as soon as you click the "Back" button, you are immediately redirected to the current page. By clicking several times in a row, the redirect does not have enough time to complete, so you can go to the page before that.

0
source

In some sites, they disable it using the following code.

 window.history.forward(); 
0
source

Source: https://habr.com/ru/post/889706/


All Articles