I would like for windows to be notified before they are closed, so they can safely unsubscribe from event listeners or release resources.
I would also wish for the windows to be able to delay their closing so that they can take the time they need to release their resources.
Today, I’m trying to use the window:beforeunload
event, but it does not always offer enough time to complete all the needed operations.
Thanks