Thank you Adam for taking the time to create this ticket, and for linking adequate resources to do proper triage.
I'm accepting on the basis that this makes sense but I would like to see more research being done regarding what to use to replace unload
. The linked MDN docs say:
The pagehide event is sent to a Window when the browser hides the current page in the process of presenting a different page from the session's history.
For example, when the user clicks the browser's Back button, the current page receives a pagehide event before the previous page is shown.
Is not immediately clear to me that this is a good replacement. From these Chrome docs we may need to evaluate visbilitychange
as well.