files/en-us/web/api/xrsession/domoverlaystate/index.md
{{APIRef("WebXR Device API")}}{{SeeCompatTable}}{{SecureContext_Header}}
The read-only domOverlayState property of an immersive-ar
{{DOMxRef("XRSession")}} provides information about the DOM overlay, if the feature is enabled.
Returns null if the DOM overlay feature is not supported or not enabled or an object containing information about the DOM overlay state with the following properties:
type
screen
head-locked
floating
if (session.domOverlayState) {
console.log(session.domOverlayState.type);
} else {
console.log("DOM overlay not supported or enabled!");
}
{{Specifications}}
{{Compat}}