I’m a new guy in this company and I’ve been tasked to research on possible workarounds with the browser behaviors to cater to the demands of our client.
A little background; what they want is to display a ‘custom’ dialog whenever a user would like to navigate away from a page (not the browser default) that has a form, just as how facebook does it. I’ve found a workaround with the Back
button in the form of browser states and have it integrated in my local build of the web app. Works like a charm, though I’m not convinced this is good practice. (more of a trick if you ask me)
The problem is the Refresh
event. All my research (here’s one) tells me I should give up. Sigh…
So I’m looking for a way to convince my superiors that this it’s a bad practice to override browser behaviors or how it’s virtually impossible to override the refresh behavior; diplomatically as much as possible. (if I could do citations on articles that would further prove my point, that would be great)
Or do I continue looking for possible workarounds in the internet? (too much research effort but not much accomplishment if you ask me, but hey, what do I know?)
2
We all know what they’re asking you to do is wrong, hard to do (because its wrong), will annoy the user (because its wrong) and will encourage them to find and use workarounds (which they’ll do because what you’re doing is wrong).
So, you’ve stated you need to change the way the back button works, and also how the refresh works. The thing is, these aren’t really problems they’re bringing you, this is their solution and implementation for how to solve a problem.
If I were you, I would try and find out what the hell the actual problem that they’re trying to solve in the first place is. Then, when you know what the problem is, you can propose some sort of alternate (and hopefully sane) solution.
I have often been tasked with implementing someone elses idea for a fix, instead of being tasked with solving a problem. Every time I have had doubts or worries about the implementation (like you’re having now) I have found out the actual problem being experienced and implemented a proper solution (WARNING: may result in managers being annoyed if they’re control freaks). As long as the solution is a proper fit, doesn’t end up being hacky, or take too long, it should go down well.
3