This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The layer property of the XRLayerEvent interface is a reference to the XRLayer which generated the event.
An XRLayer.
layer propertyIn this example, the layer property is used to obtain the XRLayer object that sent the event.
myLayer.addEventListener("redraw", (e) => {
if (e.layer instanceof XRQuadLayer) {
// redraw quad layer
}
});
| Specification |
|---|
| WebXR Layers API Level 1> # dom-xrlayerevent-layer> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
layer |
No | No | No | No | No | No | No | No | No | No | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRLayerEvent/layer