6 ms·
Why!? Another web page hijacking my back button!!
by edf13 6y ago
Why!? Another web page hijacking my back button!!
- OJFord 6y agoAgh, yeah. I can sort of see how this made sense in the early days of webapps, but now that everyone is so conditioned to using 'apps' I think aside from it being annnoying 'leave my browser chrome alone' behaviour that shouldn't be allowed, sites shouldn't even want to. I doubt many people use a webapp/SPA and click the browser back instead of the in-app back when they want in-app navigation, these days.
- shock 6y ago> I doubt many people use a webapp/SPA and click the browser back instead of the in-app back when they want in-app navigation, these days. I have back/forward buttons on my mouse and I use those. Why would I move the mouse to click an in-app navigation button instead?
- thayne 6y agoNot to mention, that I also use keyboard shortcuts to navigate back, to avoid having to move my hand to the mouse.
- Sayrus 6y agoI do like being able to use native controls to go back and forth and not having to use the application button. The same way you often use the OS back button on mobile instead of using the (usually) top-left button. I this what the original meant is that this implementation here is flawed. Once you are on the website, the back button won't bring you back to Hacker News ... ever. Even spamming the back button, you'll get stuck on the redirection to /directions which is annoying and definitely broken. This kind of redirection loops should be forbidden.
- aasasd 6y ago> I doubt many people use a webapp/SPA and click the browser back instead of the in-app back when they want in-app navigation On phones, the native ‘back’ button is vastly more easy to tap than searching for where the designer placed their button this time and then likely reaching for the farthest corner of the screen, opposite of where my thumbs are. So much so that I get surprised and annoyed when a page that has fullscreen-y dialogs doesn't close them on ‘back’ but returns me to another page instead. On desktop, personally for me at least one of the hands is usually on the keyboard in the proximity of ‘backspace’, which is again a no-brainer to mash. So the same consideration applies.
- swiley 6y agoI thought most phones got rid of the back button, or do you mean the one in the mobile browser chrome?
- aasasd 6y agoStill there on Pixel 4, afaics. I'm certainly using it with Android 10 on my phone.
- OJFord 6y agoThe physical one sure, but Android has a system UI bar at the bottom (iff there aren't physical equivalents, which as you say there mostly aren't now) with back, home, and app switching buttons. I've been trying iOS for the last couple of months, and especially initially that back button was one of my most missed features; it still annoys me, I've just stopped expecting it.
- xtiansimon 6y agoI'm not sure about in-app. For me I just wanted to get back to this post in HN, because the link opened in the same tab.
- still_grokking 6y agoI'm using mouse gestures and I go totally crazy if I get dropped out of an app because I used the "back" gesture not even thinking about it. That's super annoying and a mayor usability bug, imho.
- laszlokorte 6y agoBrowsers should internally replace `history.pushState` by `history.replaceState` calls if they do not happen during a click event (and even then limit the number of pushState calls to one)
- microcolonel 6y agoThat would be an accessibility nightmare.
- laszlokorte 6y agoWhy exactly? Indeed I have not thought about every detail but as I see it: - pushState is only used for overriding the default behavior, mostly to keep the url bar in sync with changing client state - pushState pollutes the browsers history - users have a mental model of how many steps/clicks they performed on a site and expect that an equal number of clicks on the back button brings them back to the beginning - users are upset if that expectation is not matched The site should not have control over the users history in the first place but for SPA it's necessary to achieve the expected behavior. But the browser should make sure that it's not misused. In the same way that pop-ups are blocked outside of whitelisted event listeners to prevent a website from polluting your screen, pushState should be blocked to prevent history pollution.
- thayne 6y agowell, limiting it to just click events won't work if you navigate using the keyboard, or voice commands.
- laszlokorte 6y agoWell as you can say the same for popup windows which should work for keyboard navigation and voice commands as well, I assume there is a defined class of events that count as active user interaction and I assume that onload, mousemove and onresize do not fall in that category but click, keypress do. Anyway if you focus a button and press it by hitting the spacebar or enter key a javascript click event is triggered as well. So even if you would limit it to click events I guess it would for a large portion of keyboard navigation as well.
- AnonC 6y agoI came here to write about this. This site trashed my back navigation in certain cases and I couldn’t get back to the (external) page I was at before. I just lost my navigation history.
- zozbot234 6y agoClick-and-hold/right click on the button and you should be able to resolve any "hijacking". I'm not sure why people complain about this, it's not hard to deal with.
- bronco21016 6y agoHow about mobile?
- zozbot234 6y agoDoesn't tap-and-hold work?
- bronco21016 6y agoLearn something new every day!
- conradfr 6y agoIt works on Firefox Android with both the OS and browser's back button.
- microcolonel 6y agoIt pans the map with my back navigation mouse button too, it's so wrong. I wonder where the repository is.