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?)


1 Answer 1


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.

  • Yeah but what they want is a custom modal dialog to be displayed for UI consistency. Honestly, I don't know how to argue with that in a way that won't offend them :( Commented Aug 13, 2013 at 5:47
  • in your op you mention "just how facebook does it".. does facebook try and override my browsers buttons? i don't think it does. i would ask for a site that has this sort of behaviour for you to use as a template.
    – spaceman
    Commented Aug 13, 2013 at 6:22
  • it doesn't actually, only tricks you using browser states, basically loading the inbox page twice, the first having the popup dialog open so when you press back, you get the dialog. Plus when you click refresh it shows the standard browser dialog. Commented Aug 13, 2013 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.