I'm considering implementing a WebAssembly App as 'just another Client', following the MVP pattern, and using Kotlin/wasm32, writing a View layer using the HTML DOM klib.
One obvious problem I'm wondering about when taking this approach, is the browser back button: if writing a stateful WebAssembly 'Application', then the browser back-button would, on the face of it, be like an 'immediate quit', losing all the App state and potentially ruining the UX. Is there a way to veto or intercept the back-button? (I'm an experienced mobile dev. but a dummy when it comes to front-end web... hoping to crack that with wasm)
Normally I'd be against taking control of the back-button but this seems like a valid use case (i.e. intercept the 'back's for your Apps own purposes, until it's at 'root' and the next 'back' is then passsed to the browser for an actual 'back').