logoalt Hacker News

nottorptoday at 8:00 AM4 repliesview on HN

So why don't google just disable the possibility of hijacking the back button in Chrome, to give an example?


Replies

dominicrosetoday at 8:09 AM

It's not clear what constitutes a hijacking and how they are going to detect it. It may be OK to override the button as long as it's used in the intended way which is to go back. In a single-page application it may not trigger a navigation event.

show 1 reply
red_admiraltoday at 8:21 AM

In an "application" model rather than a "document" one, like MS Word online or draw.io or similar, there's no clear semantics for "back" but there is a risk of the user losing data if they can navigate away without saving.

show 1 reply
worksonminetoday at 8:18 AM

This would break so many websites. There are valid uses for the history API, I often do modals/popups as shareable URLs, and using the back button closes it.