You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the steps for terminating a presentation don't fire a terminated event on connections held by the receiver. If the process of closing the receiving browsing context could allow script to run, then we should consider firing this event (on the top-level or nested browsing contexts). Doing so may be redundant with the 'beforeunload' event however.
Using WhatWG [1] as a reference, there are three possible events that may fire during step 2 of presentation termination (unloading the presentation document).
onbeforeunload
onpagehide
onunload
Comparing other device specs:
As part of the "unload a document cleanup steps," the browser also "makes disappear" any open WebSocket objects [2], which closes the network transport but does not fire any events.
A MediaStreamTrack may fire an ended event [3].
A RTCPeerConnection does not clearly define what happens on unload. Presumably the user agent closes the peer connection, and those steps to close do not fire an event [4].
A BluetoothDevice does not spell out an document unload procedure, but the disconnection algorithm does fire an event [5].
Noting that other specs are not very consistent in whether they event when closing resources on unload, and that firing a terminate event would be redundant with beforeunload for doing per-document cleanup, I'm inclined to not add a step to fire a terminate event on receiving presentation connections.
However, I do think we should set the presentation connection states to terminated before unloading the receiving browsing context so that state is available to beforeunload and other handlers.
Currently, the steps for terminating a presentation don't fire a
terminated
event on connections held by the receiver. If the process of closing the receiving browsing context could allow script to run, then we should consider firing this event (on the top-level or nested browsing contexts). Doing so may be redundant with the 'beforeunload' event however.Reference material:
The text was updated successfully, but these errors were encountered: