ryoblog/src/blog/stop-breaking-back-button/index.md

1.8 KiB

title: Stop breaking the back button! author: 寮 date: 2022-08-06 07:40:00 tags:technology,webdev,internet threadid: AMERNY9XWwoFah4dEm

This is actually quite an interesting bit of soydevery, because this particular practise has been around since the very beginning of the internet.
Back then, the practise was to prevent you from leaving the site using the back button unless you spam-click it.
The difference between then and now is that back then most websoytes would go up to 3 levels of history back, but nowadays it goes at least 20+ levels deep just to make absolutely sure you can't even leave if you right click the back button.
Mobile users get abused even harder through this practise, because they can't right click, neither they can spam-click the back button.

Another problem that exists today with the back button is the use of so-called "virtual routing" using JavaScript.
This one breaks the back button in the opposite direction; instead from preventing you from leaving the soyte, it actually lets you leave the soyte regardless of how many times you've clicked on other "pages".
Remember, the HTTP protocol was never designed to function that way.
Hell, even vanilla JavaScript didn't have this whole concept in mind when they came up with the history.back() command, something that every single browser (with the exception of Internet Exploiter until IE10 apparently) supported from day 1.

Web browsers and the web in general are designed to flick from one static page to the other.
This is why all browsers without exception include a back and forward button (or functionality thereof in the case of Vim-based browsers).
So if you respect your visitors, please leave the back and forward buttons the fuck alone.