Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The WebXR Device API's XRSessionEvent() constructor creates and returns a new XRSessionEvent object. These objects represent events announcing state changes in an XRSession representing an augmented or virtual reality session.
new XRSessionEvent(type, options)typeA string with the name of the event. It is case-sensitive and browsers set it to end or visibilitychange.
optionsAn object that, in addition of the properties defined in Event(), can have the following properties:
sessionThe XRSession to which the event is to be delivered.
A new XRSessionEvent object representing an object of the specified type and configured as described by the options parameter.
See XRSessionEvent for example code.