recursal/MDN huggingface dataset:
Screen: mozEnabled property
===========================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

 This Boolean attribute controls the device's screen. Setting it to `false`
 will turn off the screen.

Value
-----

A boolean.

Specifications
--------------

Not part of specification.

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Screen: unlockOrientation() method
==================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`Screen.unlockOrientation()`** method removes all the
 previous screen locks set by the page/app. The `ScreenOrientation.unlock()`
 method should be used instead.

**Warning:** This feature is deprecated and should be avoided. Use the `ScreenOrientation.unlock()` method instead.


**Note:** This method only works for installed Web apps or for Web pages
 in fullscreen mode.


Syntax
------


```js
unlockOrientation()
```

### Parameters

None.

### Return value

 Returns `true` if the orientation was successfully unlocked or
 `false` if the orientation couldn't be unlocked.

Examples
--------


```js
const unlockOrientation =
  screen.unlockOrientation ||
  screen.mozUnlockOrientation ||
  screen.msUnlockOrientation ||
  (screen.orientation && screen.orientation.unlock);

if (unlockOrientation()) {
  // orientation was unlocked
} else {
  // orientation unlock failed
}
```

Specifications
--------------

This feature is not part of any specification. It is no longer on track to becoming a standard.

Use `ScreenOrientation.unlock()` instead.

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Screen.orientation`
* `Screen.lockOrientation()`
* `orientationchange` event
* Managing screen orientation
Screen: isExtended property
===========================

**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 **`isExtended`** read-only property of the
 `Screen` interface returns `true` if the user's device has multiple screens, and `false` if not.

This property is typically accessed via `window.screen.isExtended`, and can be used to test whether multiple screens are available before attempting to create a multi-window, multi-screen layout using the Window Management API.

Value
-----

A boolean value — `true` if the device has multiple screens, and `false` if not.

**Note:** If a `window-management` Permissions-Policy is set that blocks use the Window Management API, `isExtended` will always return `false`.

Examples
--------


```js
if (window.screen.isExtended) {
  // Create multi-screen window layout
} else {
  // Create single-screen window layout
}
```

Specifications
--------------

| Specification |
| --- |
| Window Management # api-screen-isExtended-attribute |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Window Management API
Screen: width property
======================

 The **`Screen.width`** read-only property returns the width of
 the screen in CSS pixels.

Value
-----

A number.

Examples
--------


```js
// Crude way to check that the screen is at least 1024x768
if (window.screen.width >= 1024 && window.screen.height >= 768) {
  // Resolution is 1024x768 or above
}
```

Notes
-----

 Note that not all of the width given by this property may be available to the window
 itself. When other widgets occupy space that cannot be used by the `window`
 object, there is a difference in `window.screen.width` and
 `window.screen.availWidth`. See also `screen.height`.

Specifications
--------------

| Specification |
| --- |
| CSSOM View Module # dom-screen-width |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Screen: colorDepth property
===========================

 The **`Screen.colorDepth`** read-only property returns the
 color depth of the screen. Per the CSSOM, some implementations return `24`
 for compatibility reasons. See the browser compatibility section for those that don't.

Value
-----

A number.

Examples
--------


```js
// Check the color depth of the screen
if (window.screen.colorDepth < 8) {
  // Use low-color version of page
} else {
  // Use regular, colorful page
}
```

Specifications
--------------

| Specification |
| --- |
| CSSOM View Module # dom-screen-colordepth |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Screen.pixelDepth`
Screen: orientation property
============================

 The **`orientation`** read-only property of the
 `Screen` interface returns the current orientation of the screen.

Value
-----

 An instance of `ScreenOrientation` representing the orientation of the
 screen.

 Note that older, prefixed versions returned a string equivalent to
 `ScreenOrientation.type`.

Examples
--------


```js
switch (screen.orientation.type) {
  case "landscape-primary":
    console.log("That looks good.");
    break;
  case "landscape-secondary":
    console.log("Mmmh… the screen is upside down!");
    break;
  case "portrait-secondary":
  case "portrait-primary":
    console.log("Mmmh… you should rotate your device to landscape");
    break;
  default:
    console.log("The orientation API isn't supported in this browser :(");
}
```

Specifications
--------------

| Specification |
| --- |
| Screen Orientation # dom-screen-orientation |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `ScreenOrientation`
* `orientationchange` event
* Managing screen orientation
VRPose: angularVelocity property
================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The **`angularVelocity`** read-only property of the `VRPose` interface returns an array representing the angular velocity vector of the `VRDisplay` at the current timestamp, in radians per second.

**Note:** This property was part of the old WebVR API. It has been superseded by the WebXR Device API.

In other words, the current velocity at which the sensor is rotating around the `x`, `y`, and `z` axes.

Value
-----

A `Float32Array`, or `null` if the VR sensor is not able to provide angular velocity information.

Examples
--------


```js
// rendering loop for a VR scene
function drawVRScene() {
  // WebVR: Request the next frame of the animation
  vrSceneFrame = vrDisplay.requestAnimationFrame(drawVRScene);

  // Populate frameData with the data of the next frame to display
  vrDisplay.getFrameData(frameData);

  // Retrieve the angular velocity values for use in rendering
  // curFramePose is a VRPose object
  const curFramePose = frameData.pose;
  const angVel = curFramePose.angularVelocity;
  const avx = angVel[0];
  const avy = angVel[1];
  const avz = angVel[2];

  // render the scene
  // …

  // WebVR: submit the rendered frame to the VR display
  vrDisplay.submitFrame();
}
```

Specifications
--------------

This property was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.

Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers [1].

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebVR API
VRPose: angularAcceleration property
====================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The **`angularAcceleration`** read-only property of the `VRPose` interface returns an array representing the angular acceleration vector of the `VRDisplay` at the current timestamp, in meters per second per second.

**Note:** This property was part of the old WebVR API. It has been superseded by the WebXR Device API.

In other words, the current acceleration of the sensor's rotation around the `x`, `y`, and `z` axes.

Value
-----

A `Float32Array`, or `null` if the VR sensor is not able to provide angular acceleration information.

Examples
--------


```js
// rendering loop for a VR scene
function drawVRScene() {
  // WebVR: Request the next frame of the animation
  vrSceneFrame = vrDisplay.requestAnimationFrame(drawVRScene);

  // Populate frameData with the data of the next frame to display
  vrDisplay.getFrameData(frameData);

  // Retrieve the angular acceleration values for use in rendering
  // curFramePose is a VRPose object
  const curFramePose = frameData.pose;
  const angAcc = curFramePose.angularAcceleration;
  const aax = angAcc[0];
  const aay = angAcc[1];
  const aaz = angAcc[2];

  // render the scene
  // …

  // WebVR: submit the rendered frame to the VR display
  vrDisplay.submitFrame();
}
```

Specifications
--------------

This property was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.

Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers [1].

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebVR API
VRPose: position property
=========================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The **`position`** read-only property of the `VRPose` interface returns the position of the `VRDisplay` at the current timestamp as a 3D vector.

**Note:** This property was part of the old WebVR API. It has been superseded by the WebXR Device API.

The coordinate system is as follows:

* Positive X is to the user's right.
* Positive Y is up.
* Positive Z is behind the user.

Positions are measured in meters from an origin point — this point is either the position the sensor was first read at, or the position of the sensor at the point that `VRDisplay.resetPose()` was last called.

**Note:** By default, all positions are given as a sitting space position. Transforming this point with `VRStageParameters.sittingToStandingTransform` — when you are working with a room display for example — converts this to a standing space position.

Value
-----

A `Float32Array`, or null if the VR sensor is not able to provide position data.

**Note:** User agents may provide emulated position values through techniques such as neck modeling; when doing so they should still report `VRDisplayCapabilities.hasPosition` as false.

Examples
--------

See `VRDisplay.getFrameData()` for example code.

Specifications
--------------

This property was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.

Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers [1].

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebVR API
VRPose: linearAcceleration property
===================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The **`linearAcceleration`** read-only property of the `VRPose` interface returns an array representing the linear acceleration vector of the `VRDisplay` at the current timestamp, in meters per second per second.

**Note:** This property was part of the old WebVR API. It has been superseded by the WebXR Device API.

In other words, the current acceleration of the sensor, along the `x`, `y`, and `z` axes.

Value
-----

A `Float32Array`, or `null` if the VR sensor is not able to provide linear acceleration data.

Examples
--------


```js
// rendering loop for a VR scene
function drawVRScene() {
  // WebVR: Request the next frame of the animation
  vrSceneFrame = vrDisplay.requestAnimationFrame(drawVRScene);

  // Populate frameData with the data of the next frame to display
  vrDisplay.getFrameData(frameData);

  // Retrieve the linear acceleration values for use in rendering
  // curFramePose is a VRPose object
  const curFramePose = frameData.pose;
  const linAcc = curFramePose.linearAcceleration;
  const lax = linAcc[0];
  const lay = linAcc[1];
  const laz = linAcc[2];

  // render the scene
  // …

  // WebVR: submit the rendered frame to the VR display
  vrDisplay.submitFrame();
}
```

Specifications
--------------

This property was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.

Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers [1].

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebVR API
VRPose: orientation property
============================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The **`orientation`** read-only property of the `VRPose` interface returns the orientation of the sensor at the current timestamp, as a quarternion value.

**Note:** This property was part of the old WebVR API. It has been superseded by the WebXR Device API.

The value is a `Float32Array`, made up of the following values:

* pitch — rotation around the X axis.
* yaw — rotation around the Y axis.
* roll — rotation around the Z axis.
* w — the fourth dimension (usually 1).

The orientation yaw (rotation around the y axis) is relative to the initial yaw of the sensor when it was first read or the yaw of the sensor at the point that `VRDisplay.resetPose()` was last called.

Value
-----

A `Float32Array`, or `null` if the VR sensor is not able to provide orientation data.

Examples
--------

See `VRDisplay.getFrameData()` for example code.

**Note:** An orientation of `{ x: 0, y: 0, z: 0, w: 1 }` is considered to be "forward".

Specifications
--------------

This property was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.

Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers [1].

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebVR API
VRPose: linearVelocity property
===============================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The **`linearVelocity`** read-only property of the `VRPose` interface returns an array representing the linear velocity vector of the `VRDisplay` at the current timestamp, in meters per second.

**Note:** This property was part of the old WebVR API. It has been superseded by the WebXR Device API.

In other words, the current velocity at which the sensor is moving along the `x`, `y`, and `z` axes.

Value
-----

A `Float32Array`, or `null` if the VR sensor is not able to provide linear velocity data.

Examples
--------


```js
// rendering loop for a VR scene
function drawVRScene() {
  // WebVR: Request the next frame of the animation
  vrSceneFrame = vrDisplay.requestAnimationFrame(drawVRScene);

  // Populate frameData with the data of the next frame to display
  vrDisplay.getFrameData(frameData);

  // Retrieve the linear velocity values for use in rendering
  // curFramePose is a VRPose object
  const curFramePose = frameData.pose;
  const linVel = curFramePose.linearVelocity;
  const lvx = linVel[0];
  const lvy = linVel[1];
  const lvz = linVel[2];

  // render the scene
  // …

  // WebVR: submit the rendered frame to the VR display
  vrDisplay.submitFrame();
}
```

Specifications
--------------

This property was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.

Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers [1].

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* WebVR API
ReportBody: toJSON() method
===========================

The **`toJSON()`** method of the `ReportBody` interface is a *serializer*, and returns a JSON representation of the `ReportBody` object.

Syntax
------


```js
toJSON()
```

### Parameters

None.

### Return value

A JSON object that is the serialization of the `ReportBody` object.

Examples
--------

In this example we create a new `ReportingObserver` to observe intervention reports, then return a JSON representation of the first entry. The report, and therefore the JSON object returned will be an instance of `InterventionReportBody` which inherits from `ReportBody`.


```js
const options = {
  types: ["intervention"],
  buffered: true,
};

const observer = new ReportingObserver(([firstReport], observer) => {
  console.log(firstReport.toJSON());
}, options);
```

Specifications
--------------

| Specification |
| --- |
| Reporting API # dom-reportbody-tojson |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.