recursal/MDN huggingface dataset:
Report: url property
====================

 The **`url`** read-only property of the `Report`
 interface returns the URL of the document that generated the report.

Value
-----

A string representing the URL of the document that generated the report.

Examples
--------


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

const observer = new ReportingObserver(([firstReport], observer) => {
  // Log the URL of the document that generated the first report
  // e.g. "https://www.example.com/cats.html"
  console.log(firstReport.url);
}, options);
```

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

| Specification |
| --- |
| Reporting API # dom-report-url |

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

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

See also
--------

* Reporting API
FileSystemDirectoryReader: readEntries() method
===============================================

 The `FileSystemDirectoryReader` interface's **`readEntries()`** method retrieves the directory entries
 within the directory being read and delivers them in an array to a provided callback function.

 The objects in the array are all based upon `FileSystemEntry`.
 Generally, they are either `FileSystemFileEntry` objects, which represent standard files, or `FileSystemDirectoryEntry` objects, which represent directories.

Syntax
------


```js
readEntries(successCallback)
readEntries(successCallback, errorCallback)
```

### Parameters

`successCallback`

 A function which is called when the directory's contents have been retrieved. The
 function receives a single input parameter: an array of file system entry objects,
 each based on `FileSystemEntry`. Generally, they are either
 `FileSystemFileEntry` objects, which represent standard files, or
 `FileSystemDirectoryEntry` objects, which represent directories. If there
 are no files left, or you've already called `readEntries()` on this
 `FileSystemDirectoryReader`, the array is empty.


`errorCallback` Optional

 A callback function which is called if an error occurs while reading from the
 directory. It receives one input parameter: a `DOMException` object
 describing the error which occurred.


### Return value

None (`undefined`).

Examples
--------

See `DataTransferItem.webkitGetAsEntry()` for example code that uses this method.

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

| Specification |
| --- |
| File and Directory Entries API # dom-filesystemdirectoryreader-readentries |

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

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

 On Chrome 77, `readEntries()` will only return the first 100 `FileSystemEntry` instances. In order to obtain all of the
 instances, `readEntries()` must be called multiple times.

See also
--------

* File and Directory Entries API
* Introduction to the File and Directory Entries API
* `FileSystemDirectoryEntry`
* `FileSystem`
XRViewerPose: views property
============================

 The read-only `XRViewerPose` property **`views`**
 returns an array which contains every `XRView` which must be rendered in
 order to fully represent the scene from the viewpoint defined by the viewer pose. For
 monoscopic devices, this array contains a single view.


**Warning:** There is no guarantee that the number of views will
 remain constant over the lifetime of an `XRSession`. For each frame, you
 should always use the current length of this array rather than caching the value.


 Stereo views require two views to render properly, with the left eye's view having its
 `eye` set to the string `left` and the right eye's
 view a value of `right`.

Value
-----

 An array of `XRView` objects, one for each view available as part of the
 scene for the current viewer pose. This array's length may potentially vary over the
 lifetime of the `XRSession` (for example, if the viewer enables or disables
 stereo mode on their XR output device).

Examples
--------

See `XRViewerPose` for example code.

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

| Specification |
| --- |
| WebXR Device API # dom-xrviewerpose-views |

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

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

See also
--------

* WebXR Device API
* Movement, orientation, and motion
VideoDecoder: flush() method
============================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`flush()`** method of the `VideoDecoder` interface returns a Promise that resolves once all pending messages in the queue have been completed.

Syntax
------


```js
flush()
```

### Parameters

None.

### Return value

A `Promise` that resolves with undefined.

### Exceptions

`InvalidStateError` `DOMException`

Returned if the Promise is rejected because the `state` is not `configured`.

Examples
--------

The following example flushes the `VideoDecoder`.


```js
VideoDecoder.flush();
```

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

| Specification |
| --- |
| WebCodecs # dom-videodecoder-flush |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
VideoDecoder: VideoDecoder() constructor
========================================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`VideoDecoder()`** constructor creates a new `VideoDecoder` object with the provided `init.output` callback assigned as the output callback, the provided `init.error` callback as the error callback, and the `VideoDecoder.state` set to `"unconfigured"`.

Syntax
------


```js
new VideoDecoder(options)
```

### Parameters

`options`

An object containing two callbacks.

`output`

A callback which takes a `VideoFrame` object as its only argument.

`error`

A callback which takes an `Error` object as its only argument.


Examples
--------

In the following example a `VideoDecoder` is created with the two required callback functions, one to deal with the decoded frame and the other to handle errors.


```js
const videoDecoder = new VideoDecoder({
  output: processVideo,
  error: onEncoderError,
});
```

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

| Specification |
| --- |
| WebCodecs # dom-videodecoder-videodecoder |

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

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

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`isConfigSupported()`** static method of the `VideoDecoder` interface checks if the given config is supported (that is, if `VideoDecoder` objects can be successfully configured with the given config).

Syntax
------


```js
VideoDecoder.isConfigSupported(config)
```

### Parameters

`config`

The dictionary object accepted by `VideoDecoder.configure`

### Return value

A `Promise` that resolves with an object containing the following members:

`supported`

A boolean value which is `true` if the given config is supported by the decoder.

`config`

A copy of the given config with all the fields recognized by the decoder.

### Exceptions

`TypeError`

Thrown if the provided `config` is invalid; that is, if doesn't have required values (such as an empty `codec` field) or has invalid values (such as a negative `codedWidth`).

Examples
--------

 The following example tests if the browser supports accelerated and un-accelerated
 versions of several video codecs.


```js
const codecs = ["avc1.42001E", "vp8", "vp09.00.10.08", "av01.0.04M.08"];
const accelerations = ["prefer-hardware", "prefer-software"];

const configs = [];
for (const codec of codecs) {
  for (const acceleration of accelerations) {
    configs.push({
      codec,
      hardwareAcceleration: acceleration,
      codedWidth: 1280,
      codedHeight: 720,
      not\_supported\_field: 123,
    });
  }
}

for (const config of configs) {
  const support = await VideoDecoder.isConfigSupported(config);
  console.log(
    `VideoDecoder's config ${JSON.stringify(support.config)} support: ${
 support.supported
 }`,
  );
}
```

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

| Specification |
| --- |
| WebCodecs # dom-videodecoder-isconfigsupported |

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

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

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`reset()`** method of the `VideoDecoder` interface resets all states including configuration, control messages in the control message queue, and all pending callbacks.

Syntax
------


```js
reset()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------

The following example resets the `VideoDecoder`.


```js
VideoDecoder.reset();
```

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

| Specification |
| --- |
| WebCodecs # dom-videodecoder-reset |

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

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

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`state`** property of the `VideoDecoder` interface returns the current state of the underlying codec.

Value
-----

A string containing one of the following values:

`"unconfigured"`

The codec is not configured for decoding.

`"configured"`

The codec has a valid configuration and is ready.

`"closed"`

The codec is no longer usable and system resources have been released.

Examples
--------

The following example prints the state of the `VideoDecoder` to the console.


```js
console.log(VideoDecoder.state);
```

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

| Specification |
| --- |
| WebCodecs # dom-videodecoder-state |

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

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

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`decodeQueueSize`** read-only property of the `VideoDecoder` interface returns the number of pending decode requests in the queue.

Value
-----

An integer containing the number of requests.

Examples
--------

The following example prints the size of the queue to the console.


```js
console.log(VideoDecoder.decodeQueueSize);
```

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

| Specification |
| --- |
| WebCodecs # dom-videodecoder-decodequeuesize |

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

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

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`close()`** method of the `VideoDecoder` interface ends all pending work and releases system resources.

Syntax
------


```js
close()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------

The following example closes the `VideoDecoder`.


```js
VideoDecoder.close();
```

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

| Specification |
| --- |
| WebCodecs # dom-videodecoder-close |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
VideoDecoder: dequeue event
===========================

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`dequeue`** event of the `VideoDecoder` interface fires to signal a decrease in `VideoDecoder.decodeQueueSize`.

This eliminates the need for developers to use a `setTimeout()` poll to determine when the queue has decreased, and more work should be queued up.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("dequeue", (event) => {});

ondequeue = (event) => {};
```

Example
-------


```js
videoDecoder.addEventListener("dequeue", (event) => {
  // Queue up more encoding work
});
```

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

| Specification |
| --- |
| WebCodecs # eventdef-videodecoder-dequeue |

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

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

Limited availability
--------------------

This feature is not Baseline because it does not work in some of the most widely-used browsers.

* Learn more
* See full compatibility
* Report feedback
**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`decode()`** method of the `VideoDecoder` interface enqueues a control message to decode a given chunk of video.

Syntax
------


```js
decode(chunk)
```

### Parameters

`chunk`

An `EncodedVideoChunk` object representing a chunk of encoded video.

### Return value

None (`undefined`).

### Exceptions

`InvalidStateError` `DOMException`

Thrown if the `state` is not `configured`.

`DataError` `DOMException`

Thrown if the `chunk` is unable to be decoded due to relying on other frames for decoding.

Examples
--------

The following example demonstrates how to use the `decode()` method to decode `EncodedVideoChunk` objects created from encoded video data.


```js
const responses = await downloadVideoChunksFromServer(timestamp);
for (const response of responses) {
  const chunk = new EncodedVideoChunk({
    timestamp: response.timestamp,
    type: response.key ? "key" : "delta",
    data: new Uint8Array(response.body),
  });
  decoder.decode(chunk);
}
```

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

| Specification |
| --- |
| WebCodecs # dom-videodecoder-decode |

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

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

The **`takeRecords()`** method of the `PerformanceObserver` interface returns the current list of `performance entries` stored in the performance observer, emptying it out.

Syntax
------


```js
takeRecords()
```

### Parameters

None.

### Return value

A list of `PerformanceEntry` objects.

Examples
--------

### Taking records

The following example stores the current list of performance entries into `records` and empties the performance observer.


```js
const observer = new PerformanceObserver((list, obj) => {
  list.getEntries().forEach((entry) => {
    // Process "mark" and "measure" events
  });
});
observer.observe({ entryTypes: ["mark", "measure"] });
const records = observer.takeRecords();
console.log(records[0].name);
console.log(records[0].startTime);
console.log(records[0].duration);
```

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

| Specification |
| --- |
| Performance Timeline # dom-performanceobserver-takerecords |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
PerformanceObserver: PerformanceObserver() constructor
======================================================

The **`PerformanceObserver()`** constructor creates a new `PerformanceObserver` object with the given observer `callback`. The observer callback is invoked when performance entry events are recorded for the entry types that have been registered, via the `observe()` method.

Syntax
------


```js
new PerformanceObserver(callback)
```

### Parameters

`callback`

A `PerformanceObserverCallback` callback that will be invoked when observed performance events are recorded. When the callback is invoked, the following parameters are available:

`entries`

The list of performance observer entries.

`observer`

The `observer` object that is receiving the above entries.

`droppedEntriesCount` Optional

The number of buffered entries which got dropped from the buffer due to the buffer being full. See the `buffered` flag.


### Return value

A new `PerformanceObserver` object which will call the specified `callback` when observed performance events occur.

Examples
--------

### Creating a PerformanceObserver

 The following example creates a `PerformanceObserver` watching for "mark" (`PerformanceMark`) and "measure" (`PerformanceMeasure`) events.
 The `perfObserver` callback provides a `list` (`PerformanceObserverEntryList`) which allows you get observed performance entries.


```js
function perfObserver(list, observer) {
  list.getEntries().forEach((entry) => {
    if (entry.entryType === "mark") {
      console.log(`${entry.name}'s startTime: ${entry.startTime}`);
    }
    if (entry.entryType === "measure") {
      console.log(`${entry.name}'s duration: ${entry.duration}`);
    }
  });
}
const observer = new PerformanceObserver(perfObserver);
observer.observe({ entryTypes: ["measure", "mark"] });
```

### Dropped buffer entries

 You can use `PerformanceObserver` with a `buffered` flag to listen to past performance entries.
 There is a buffer size limit, though. The performance observer callback contains an optional `droppedEntriesCount` parameter that informs you about the amount of lost entries due to the buffer storage being full.


```js
function perfObserver(list, observer, droppedEntriesCount) {
  list.getEntries().forEach((entry) => {
    // do something with the entries
  });
  if (droppedEntriesCount > 0) {
    console.warn(
      `${droppedEntriesCount} entries got dropped due to the buffer being full.`,
    );
  }
}
const observer = new PerformanceObserver(perfObserver);
observer.observe({ type: "resource", buffered: true });
```


Usually, there are a lot of resource timing entries, and for these entries specifically, you can also set a larger buffer using `performance.setResourceTimingBufferSize()` and watch for the `resourcetimingbufferfull` event.

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

| Specification |
| --- |
| Performance Timeline # dom-performanceobserver-constructor |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
PerformanceObserver: supportedEntryTypes static property
========================================================

The static **`supportedEntryTypes`** read-only property of the `PerformanceObserver` interface returns an array of the `entryType` values supported by the user agent.

As the list of supported entries varies per browser and is evolving, this property allows web developers to check which are available.

Value
-----

An array of `PerformanceEntry.entryType` values.

Examples
--------

### Using the console to check supported types

To find out which `entryType` values a browser supports, enter `PerformanceObserver.supportedEntryTypes` into the console. This will return an array of supported values.


```js
PerformanceObserver.supportedEntryTypes;

// returns ["element", "event", "first-input", "largest-contentful-paint", "layout-shift", "longtask", "mark", "measure", "navigation", "paint", "resource"] in Chrome 89
```

### Checking for unsupported types

The following function checks for support of an array of possible entry types. The unsupported types are logged to the console, however this information could be logged to client-side analytics to indicate that the particular type could not be observed.


```js
function detectSupport(entryTypes) {
  for (const entryType of entryTypes) {
    if (!PerformanceObserver.supportedEntryTypes.includes(entryType)) {
      console.log(entryType);
    }
  }
}

detectSupport(["resource", "mark", "first-input", "largest-contentful-paint"]);
```

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

| Specification |
| --- |
| Performance Timeline # supportedentrytypes-attribute |

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

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

The **`disconnect()`** method of the `PerformanceObserver` interface is used to stop the performance observer from receiving any performance entry events.

Syntax
------


```js
disconnect()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------

### Stopping a performance observer

The following example disconnects the performance observer to disable receiving any more performance entry events.


```js
const observer = new PerformanceObserver((list, obj) => {
  list.getEntries().forEach((entry) => {
    // Process "measure" events
    // …
    // Disable additional performance events
    observer.disconnect();
  });
});
observer.observe({ entryTypes: ["mark", "measure"] });
```

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

| Specification |
| --- |
| Performance Timeline # dom-performanceobserver-disconnect |

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

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