Hacker News new | ask | show | jobs
by otterley 2740 days ago
Can you give an example of a legitimate use case?
2 comments

Accidentally leaving a form in progress?

I believe closing gmail browser window while composing a message would show a popup.

I use it in an app where editing an item locks it for everyone else and to unlock it, one needs to save or cancel the edit. So closing the browser tab while editing shows a warning.

Edit: I was corrected by the comment below. Had in mind a different function.

That's not the window.open() call, which doesn't stop the browser window from closing. It's (I believe) a window.confirm call: https://developer.mozilla.org/en-US/docs/Web/API/Window/conf...
I like the change, trying to dig, maybe:

A kiosk at a gov/hospital that needs a browser open on a default page?

Their are probably better sys admin/mgmt tools available though.