To detect if the user is closing the IE browser apart from onunload event, as it is triggerred when user does refresh etc [duplicate]

The question isn’t an unusual one. Yet after 5 days searching the internet you still haven’t found a satisfactory answer. That in itself should be a fairly plain indicator.

What I’ve found on the web is there is a serious aversion to the ‘no can do’ answer. When something can’t be done the normal response is to make no response.

Bottom line is not only can what you are trying do not be done it should not be done.

I think you need to go back to your seniors and explain to them that a Web UI is a guest hosted by a browser on a client machine. This guest status is an important one.

Would you want a guest in your home to have the power to enforce you to alert them when you want to go to the toilet? No?

Similarly the browser limits what info the guest UI is allowed to access. Even if you found a workaround for the fact that browsers aren’t giving up this info voluntarily, such clever hacks are fragile and likely to be constant source of bugs.

Since its likely that the application was originally intended to be delivered via the browser before any code was cut, the fault lies with including the requirement in the first place.

All we can do sympathise with you in being asked to perform an near impossible and certainly not sensible requirement.

Leave a Comment