3 ms·
You break mobile apps that use a webview, as my history trail never ends
by Zetaphor 2y ago
You 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.
- breck 2y agoOk. At some point I need to clean up that code and add some unit tests. I'm sure at that point will get this fixed. This is v0.1.0 of the Explorer. Really appreciate the help!
- DangitBobby 2y agoYou could probably go ahead and start using `location.replace` with a minor refactor. The difference in behavior there would be when someone updates their query, a new entry is not added to history. Whether that's a regression or an improvement is probably user dependent. IMO, it's better not to have a bunch of history items for playing with one table.
- breck 2y agoYou are probably right. My todo list is a mile long though so won't get to this for a while. Open to pull requests.