I noticed that the HocuspocusProvider is using the deprecated unload event. MDN advises to use the pagehide event instead, so this is what I chose to use for this PR. I searched for any open and closed issues and PRs that could be related to this and hence am aware of #658 and #657, where the previously used beforeunload event was found to be problematic.
I checked if the pagehide event also fires when starting a download as described in #657 and found that it in fact does not fire. Therefore I think this event might be a viable alternative to unload.
Dear hocuspocus folks,
I noticed that the
HocuspocusProvider
is using the deprecatedunload
event. MDN advises to use thepagehide
event instead, so this is what I chose to use for this PR. I searched for any open and closed issues and PRs that could be related to this and hence am aware of #658 and #657, where the previously usedbeforeunload
event was found to be problematic.I checked if the
pagehide
event also fires when starting a download as described in #657 and found that it in fact does not fire. Therefore I think this event might be a viable alternative tounload
.Cheers, Julian