Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The XRReferenceSpaceEvent() constructor is used to create a new XRReferenceSpaceEvent object, which represents an event regarding the state of a WebXR reference space object, XRReferenceSpace.

Currently, only the reset event is defined using this type.


let refSpaceEvent = new XRReferenceSpaceEvent(type, eventInitDict);


A DOMString indicating the event type which has occurred. Currently, this is always reset.

An object based on the XRReferenceSpaceEventInit dictionary, containing data used to initialize the new event object. The properties of this object are:

The XRReferenceSpace from which the event originated.
An XRRigidTransform which maps the old coordinate system (from before the changes indicated by this event) to the new coordiante system.

Return value

A new XRReferenceSpaceEvent object, initialized as defined by the input parameters.


Specification Status Comment
WebXR Device API
The definition of 'XRReferenceSpaceEvent()' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
XRReferenceSpaceEvent() constructorChrome Full support 79Edge Full support 79Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android Full support 11.2


Full support  
Full support
No support  
No support