you cannot. it is an application feature, not a website feature. you can try to capture any events happening at the coordinates of the close button, though. (which will be useless once the window manager uses a different setting)
if you just want to know, whether the window is closed, use the beforeunload event.
Comment