recursal/MDN huggingface dataset:
RTCIceCandidateStats: type property
===================================

The **`type`** property of the `RTCIceCandidateStats` dictionary is a string with the value `"local-candidate"`.

 Different statistics are obtained by iterating the `RTCStatsReport` object returned by a call to `RTCPeerConnection.getStats()`.
 The type indicates the set of statistics available through the object in a particular iteration step.
 A value of `"local-candidate"` indicates that the statistics available in the current step are those defined in `RTCIceCandidateStats`.

Value
-----

A string with the value `"local-candidate"`.

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

| Specification |
| --- |
| Identifiers for WebRTC's Statistics API # dom-rtcstats-type |

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

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

 The `RTCIceCandidateStats` dictionary's
 **`url`** property specifies the URL of the
 ICE server from which the described candidate was obtained. This
 property is *only* available for local candidates.

Value
-----

 A string specifying the URL of the ICE server from which the
 candidate described by the `RTCIceCandidateStats` was obtained. This is the
 same URL that would be received in the `icecandidate` event's
 `url` property.

**Note:** This property does not exist for remote candidates.

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

#### No specification found

No specification data found for `api.RTCIceCandidateStats.url`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

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

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

The **`id`** property of the `RTCIceCandidateStats` dictionary is a string that uniquely identifies the object for which this object provides statistics.

Using the `id`, you can correlate this statistics object with others, in order to monitor statistics over time for a given WebRTC object, such as an `RTCPeerConnection`, or an `RTCDataChannel`.

Value
-----

A string that uniquely identifies the object for which this `RTCIceCandidateStats` object provides statistics.

The format of the ID string is not defined by the specification, so you cannot reliably make any assumptions about the contents of the string, or assume that the format of the string will remain unchanged for a given object type.

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

| Specification |
| --- |
| Identifiers for WebRTC's Statistics API # dom-rtcstats-id |

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

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

 The `RTCIceCandidateStats` dictionary's
 **`protocol`** property specifies the protocol the specified
 candidate would use for communication with the remote peer.

Value
-----

The value is one of the following string:

`tcp`

The candidate, if selected, would use TCP as the transport protocol for its data. The `tcpType` property provides additional information about the kind of TCP candidate represented by the object.

`udp`

The candidate will use the UDP transport protocol for its data. This is the preferred protocol for media interactions because of its better performance profile.

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

#### No specification found

No specification data found for `api.RTCIceCandidateStats.protocol`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

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

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

 The `RTCIceCandidateStats` dictionary's
 **`priority`** property is a positive integer value
 indicating the priority (or desirability) of the described candidate.

 During ICE negotiation while setting up a WebRTC peer connection, the
 priority values reported to the remote peer by a user agent are used
 to determine which candidates are considered "more desirable". The higher the value,
 the more desirable the candidate is.

Syntax
------


```js
priority = rtcIceCandidateStats.priority
```

### Value

 A positive integer indicating the priority of the `RTCIceCandidate`
 described by the `RTCIceCandidateStats` object. The value may be anywhere
 from 1 to 2,147,483,647.

Determining priority
--------------------

 The ICE specification describes how user agents and other software using WebRTC should
 calculate the priority. The priority of a candidate is calculated using the following
 variables as inputs:

* The preferability of the candidate type (local, server reflexive, peer reflexive,
 or relayed)
* The preferability of the candidate's specific IP address (for multihomed agents)
* The candidate's component ID (1 for RTP, 2 for RTCP)

 The candidate's priority is computed using the formula (*ptype* is
 the priority of the candidate's type and *plocal* is the priority of
 the IP address):


priority
=

2
24

×

p

type

+

2
8

×

p

local

+
(
256
-
componentID
)

priority\quad =\quad { 2 }^{ 24 }\times { p }

*{
type }\quad +\quad { 2 }^{ 8 }\times { p }*{ local }\quad +\quad (256\quad
 -\quad componentID)

 This is equivalent to mapping the priorities of the candidate type, the local IP, and
 the component ID into various bit ranges within the 32-bit `priority`
 value.

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

| Specification |
| --- |
| Identifiers for WebRTC's Statistics API # dom-rtcicecandidatestats-priority |

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

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

See also
--------

* RFC 5245, section 4.1.2.1: Recommended Formula section in the ICE specification
RTCIceCandidateStats: relayProtocol property
============================================

 The `RTCIceCandidateStats` dictionary's
 **`relayProtocol`** property specifies the protocol being used
 by a local ICE candidate to communicate with the TURN
 server.

 The ICE protocol being used by the candidate otherwise can be obtained from the
 `protocol` property.

Value
-----

 A string identifying the protocol being used by the endpoint to
 communicate with the TURN server. The possible values are:

`tcp`

TCP (Transport Control Protocol) is being used to communicate with the TURN server.

`tls`

TLS (Transport Layer Security) is being used to communicate with the TURN server.

`udp`

UDP (User Datagram Protocol) is being used to communicate with the TURN server.



**Note:** This property is only present on
 `RTCIceCandidateStats` objects that represent local candidates.


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

#### No specification found

No specification data found for `api.RTCIceCandidateStats.relayProtocol`.  
Check for problems with this page or contribute a missing `spec_url` to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

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

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

 The `RTCIceCandidateStats` dictionary's
 **`transportId`** property is a string that uniquely
 identifies the transport that produced the `RTCTransportStats` from which
 information about this candidate was taken.

Value
-----

 A string whose value uniquely identifies the transport from which any
 transport-related information accumulated in the `RTCIceCandidateStats` was
 taken. This can be used to compare candidates that would use the same transport, for
 example.

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

| Specification |
| --- |
| Identifiers for WebRTC's Statistics API # dom-rtcicecandidatestats-transportid |

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

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

 The `RTCIceCandidateStats` dictionary's **`port`**
 property specifies the network port used by the candidate.

Value
-----

 An integer value indicating the network port used by the `RTCIceCandidate`
 described by the `RTCIceCandidateStats` object.

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

| Specification |
| --- |
| Identifiers for WebRTC's Statistics API # dom-rtcicecandidatestats-port |

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

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

The **`timestamp`** property of the `RTCIceCandidateStats` dictionary is a `DOMHighResTimeStamp` object specifying the time at which the data in the object was sampled.

Value
-----

A `DOMHighResTimeStamp` value indicating the time at which the activity described by the statistics in this object was recorded, in milliseconds elapsed since the beginning of January 1, 1970, UTC.

The value should be accurate to within a few milliseconds but may not be entirely precise, either because of hardware or operating system limitations or because of fingerprinting protection in the form of reduced clock precision or accuracy.

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

| Specification |
| --- |
| Identifiers for WebRTC's Statistics API # dom-rtcstats-timestamp |

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

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

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`getTags()`** method of the
 `SyncManager` interface returns a list of developer-defined identifiers for
 `SyncManager` registrations.

Syntax
------


```js
getTags()
```

### Parameters

None.

### Return value

 A `Promise` that resolves to an array of strings
 containing developer-defined identifiers for `SyncManager` registrations.

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

| Specification |
| --- |
| Web Background Synchronization # dom-syncmanager-gettags |

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

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

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`register()`** method of the `SyncManager` interface registers a synchronization event, triggering a `sync` event inside the associated service worker as soon as network connectivity is available.

Syntax
------


```js
register(tag)
```

### Parameters

`tag`

An identifier for this synchronization event. This will be the value of the `tag` property of the `SyncEvent` that gets passed into the service worker's `sync` event handler.

### Return value

A `Promise` that resolves to `undefined`.

### Exceptions

`InvalidStateError` `DOMException`

Thrown if current service worker is not active.

`NotAllowedError` `DOMException`

Thrown if background sync has been disabled by the user.

Examples
--------

The following asynchronous function registers a background sync from a browsing context:


```js
async function syncMessagesLater() {
  const registration = await navigator.serviceWorker.ready;
  try {
    await registration.sync.register("sync-messages");
  } catch {
    console.log("Background Sync could not be registered!");
  }
}
```

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

| Specification |
| --- |
| Web Background Synchronization # dom-syncmanager-register |

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

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

 The **`devicePixelContentBoxSize`** read-only property of
 the `ResizeObserverEntry` interface returns an array containing the size in device pixels of the observed element when the callback is run.

Value
-----

 An array containing objects with the new size of the observed element in device pixels. The
 array is necessary to support elements that have multiple fragments, which occur in
 multi-column scenarios. Each object in the array contains two properties:

`blockSize`

 The size of the content-box, in device pixels, of the block dimension of the observed element. For boxes
 with a horizontal `writing-mode`, this is the vertical dimension, or
 height; if the writing-mode is vertical, this is the horizontal dimension, or width.


`inlineSize`

 The size of the content box, in device pixels, of the inline direction of the observed element. For boxes
 with a horizontal `writing-mode`, this is the horizontal dimension, or
 width; if the writing-mode is vertical, this is the vertical dimension, or height.




**Note:** For more information about writing modes and block and inline
 dimensions, read Handling different text directions.


Examples
--------

 The following example is taken from the article Pixel-perfect rendering with devicePixelContentBox. As the callback function of a `ResizeObserver`
 is called after layout but before paint.
 This provides an opportunity to log the exact size in physical pixels to
 ensure a one-to-one mapping of canvas pixels to physical pixels.


```js
const observer = new ResizeObserver((entries) => {
  const entry = entries.find((entry) => entry.target === canvas);
  canvas.width = entry.devicePixelContentBoxSize[0].inlineSize;
  canvas.height = entry.devicePixelContentBoxSize[0].blockSize;

  /\* … render to canvas … \*/
});
observer.observe(canvas, { box: "device-pixel-content-box" });
```

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

| Specification |
| --- |
| Resize Observer # dom-resizeobserverentry-devicepixelcontentboxsize |

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

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

 The **`contentBoxSize`** read-only property of
 the `ResizeObserverEntry` interface returns an array containing the new
 content box size of the observed element when the callback is run.

Value
-----

 An array containing objects with the new content box size of the observed element.
 The array is necessary to support elements that have multiple fragments, which occur in multi-column scenarios. Each object in the array contains two properties:

`blockSize`

 The length of the observed element's content box in the block dimension. For boxes
 with a horizontal `writing-mode`, this is the vertical dimension, or
 height; if the writing-mode is vertical, this is the horizontal dimension, or width.


`inlineSize`

 The length of the observed element's content box in the inline dimension. For boxes
 with a horizontal `writing-mode`, this is the horizontal dimension, or
 width; if the writing-mode is vertical, this is the vertical dimension, or height.




**Note:** For more explanation of writing modes and block and inline
 dimensions, read Handling different text directions.


Examples
--------

 The following snippet is taken from the resize-observer-border-radius.html
 (see source) example. This example includes a green box, sized as a percentage of the
 viewport size. When the viewport size is changed, the box's rounded corners change in
 proportion to the size of the box. We could just implement this using
 `border-radius` with a percentage, but that quickly leads to ugly-looking
 elliptical corners; this solution gives you nice square corners that scale with the box
 size.


```js
const resizeObserver = new ResizeObserver((entries) => {
  for (let entry of entries) {
    if (entry.contentBoxSize) {
      // The standard makes contentBoxSize an array...
      if (entry.contentBoxSize[0]) {
        entry.target.style.borderRadius =
          Math.min(
            100,
            entry.contentBoxSize[0].inlineSize / 10 +
              entry.contentBoxSize[0].blockSize / 10,
          ) + "px";
      } else {
        // ...but old versions of Firefox treat it as a single item
        entry.target.style.borderRadius =
          Math.min(
            100,
            entry.contentBoxSize.inlineSize / 10 +
              entry.contentBoxSize.blockSize / 10,
          ) + "px";
      }
    } else {
      entry.target.style.borderRadius =
        Math.min(
          100,
          entry.contentRect.width / 10 + entry.contentRect.height / 10,
        ) + "px";
    }
  }
});

resizeObserver.observe(document.querySelector("div"));
```

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

| Specification |
| --- |
| Resize Observer # dom-resizeobserverentry-contentboxsize |

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

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

 The **`borderBoxSize`** read-only property of
 the `ResizeObserverEntry` interface returns an array containing the new
 border box size of the observed element when the callback is run.

Value
-----

 An array containing objects with the new border box size of the observed element. The
 array is necessary to support elements that have multiple fragments, which occur in
 multi-column scenarios. Each object in the array contains two properties:

`blockSize`

 The length of the observed element's border box in the block dimension. For boxes
 with a horizontal `writing-mode`, this is the vertical dimension, or
 height; if the writing-mode is vertical, this is the horizontal dimension, or width.


`inlineSize`

 The length of the observed element's border box in the inline dimension. For boxes
 with a horizontal `writing-mode`, this is the horizontal dimension, or
 width; if the writing-mode is vertical, this is the vertical dimension, or height.




**Note:** For more explanation of writing modes and block and inline
 dimensions, read Handling different text directions.


Examples
--------


```js
const resizeObserver = new ResizeObserver((entries) => {
  const calcBorderRadius = (size1, size2) =>
    `${Math.min(100, size1 / 10 + size2 / 10)}px`;

  for (const entry of entries) {
    if (entry.borderBoxSize?.length > 0) {
      entry.target.style.borderRadius = calcBorderRadius(
        entry.borderBoxSize[0].inlineSize,
        entry.borderBoxSize[0].blockSize,
      );
    } else {
      entry.target.style.borderRadius = calcBorderRadius(
        entry.contentRect.width,
        entry.contentRect.height,
      );
    }
  }
});

resizeObserver.observe(document.querySelector("div"));
```

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

| Specification |
| --- |
| Resize Observer # dom-resizeobserverentry-borderboxsize |

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

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

 The **`target`** read-only property of the
 `ResizeObserverEntry` interface returns a reference to the
 `Element` or `SVGElement` that is being observed.

Value
-----

 An `Element` or `SVGElement` representing the element being
 observed.

Examples
--------

 The following snippet is taken from the resize-observer-border-radius.html
 (see source) example. This example includes a green box, sized as a percentage of the
 viewport size. When the viewport size is changed, the box's rounded corners change in
 proportion to the size of the box. We could just implement this using
 `border-radius` with a percentage, but that quickly leads to ugly-looking
 elliptical corners; this solution gives you nice square corners that scale with the box
 size.

 To grab a reference to the observed element so we can update its
 `border-radius` value after each change, we make use of the
 `target` property of each entry —
 `entry.target.style.borderRadius`.


```js
const resizeObserver = new ResizeObserver((entries) => {
  for (const entry of entries) {
    if (entry.contentBoxSize) {
      entry.target.style.borderRadius = `${Math.min(
 100,
 entry.contentBoxSize.inlineSize / 10 +
 entry.contentBoxSize.blockSize / 10,
 )}px`;
    } else {
      entry.target.style.borderRadius = `${Math.min(
 100,
 entry.contentRect.width / 10 + entry.contentRect.height / 10,
 )}px`;
    }
  }
});

resizeObserver.observe(document.querySelector("div"));
```

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

| Specification |
| --- |
| Resize Observer # dom-resizeobserverentry-target |

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

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

 The `contentRect` read-only property of the
 `ResizeObserverEntry` interface returns a `DOMRectReadOnly`
 object containing the new size of the observed element when the callback is run. Note
 that this is better supported than `ResizeObserverEntry.borderBoxSize` or
 `ResizeObserverEntry.contentBoxSize`, but it is left over from an earlier
 implementation of the Resize Observer API, is still included in the spec for web compat
 reasons, and may be deprecated in future versions.

Value
-----

 A `DOMRectReadOnly` object containing the new size of the element
 indicated by the `target` property.

 If the `target` is an HTML `Element`, the returned
 `contentRect` is the element's content box. If the `target` is an
 `SVGElement`, the returned `contentRect` is the SVG's bounding
 box.

Examples
--------

 The following snippet is taken from the resize-observer-text.html
 (see source) example. This uses a simple feature detection test to see if the browser
 supports the newer `ResizeObserverEntry.contentBoxSize` property — if so,
 it uses that to get the sizing data it needs. If not, it uses `contentRect`.


```js
const resizeObserver = new ResizeObserver((entries) => {
  for (const entry of entries) {
    if (entry.contentBoxSize) {
      h1Elem.style.fontSize = `${Math.max(
 1.5,
 entry.contentBoxSize.inlineSize / 200,
 )}rem`;
      pElem.style.fontSize = `${Math.max(
 1,
 entry.contentBoxSize.inlineSize / 600,
 )}rem`;
    } else {
      h1Elem.style.fontSize = `${Math.max(
 1.5,
 entry.contentRect.width / 200,
 )}rem`;
      pElem.style.fontSize = `${Math.max(1, entry.contentRect.width / 600)}rem`;
    }
  }
});

resizeObserver.observe(divElem);
```

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

| Specification |
| --- |
| Resize Observer # dom-resizeobserverentry-contentrect |

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

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