4 ms·
The way this website was made makes the back button useless.
by pmdr 2y ago
The way this website was made makes the back button useless.
- pjmlp 2y agoIf it was only this one.
- amelius 2y agoYou can long-press it.
- pmdr 2y agoYes, but it messes with the convenience of swiping back on your trackpad or phone.
- Zetaphor 2y agoI was viewing this page in the Harmonic app and had to quit since the Android back button was unable to exit the webview. Allowing developers to mess with the back button was a mistake, I've never used a website where that functionality didn't present a problem rather than solving one.
- breck 2y agoSorry! This page is new. The source is below: https://github.com/breck7/pldb/blob/main/code/browser/explorer/explorer.js https://github.com/breck7/pldb/blob/main/code/browser/explor... Can you explain what you are doing and what you expect? I can get a fix out.
- Bjartr 2y agoI think the back button is fine, it's the keyboard shortcut for Go Back, `alt-left`, that's broken. The `scrollKeyboardNav` element's "press left/right to go to the prev/next language" keydown handler is triggering even when alt is being held is preempting the Go Back shortcut.
- breck 2y agoAh, got it! Yeah the keyboard nav should not be on that page. Just removed it (should be live in a minute or two). Thank you! https://github.com/breck7/pldb/commit/111b2c061df080d042297f404f141457147ebcc3 https://github.com/breck7/pldb/commit/111b2c061df080d042297f...
- Zetaphor 2y agoYou break mobile apps that use a webview, as my history trail never ends
- breck 2y agoCan you please provide repro steps? Whatever is happening I am happy to fix. Also, the source code is 100% open source and pull requests are encouraged: https://github.com/breck7/pldb https://github.com/breck7/pldb
- DangitBobby 2y agoFor me, repro steps are: 1. Vist the page on Firefox Nightly for Android 2. Attempt to use the back gesture to go back 3. Observe you cannot go back Workaround is to swipe back furiously, presumably before the page is able to add additional locations to browser history. Without actually pulling this code or doing any debugging, I believe the issue is this line here, at some point during the initial page load you are setting `location.hash` (watching the actual URL I can see that it happens) which adds a navigation event to your history and interferes with the back button. https://github.com/breck7/pldb/blob/ae07a2e4dfcc15bf8c16c4cafcb34ffcdf2c7da8/code/browser/explorer/explorer.js#L101 https://github.com/breck7/pldb/blob/ae07a2e4dfcc15bf8c16c4ca...
- breck 2y agoAwesome repro steps. Appreciate the effort. Any idea why this only happens in Android on Firefox? I can't repro in Firefox on MacOS, or Chrome, or Safari. Might it be a bug in Android on Firefox?
- DangitBobby 2y agoIt also doesn't happen in Chrome in Android. I do not know why one browser would trigger that code path while another would not, perhaps they all trigger the code but most of them discard JS induced navigation events that fire during a page load.