Firefox Tomorrow

web api instance property

XRLayerEvent: layer property

View on MDN ↗

Limited availabilitySecure context

The layer property of the XRLayerEvent interface is a reference to the XRLayer which generated the event.

Value

An XRLayer.

Examples

Using the layer property

In 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
  }
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also