recursal/MDN huggingface dataset:
TaskAttributionTiming: containerType property
=============================================

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

The **`containerType`** readonly property of the `TaskAttributionTiming` interface returns the type of the container, one of `iframe`, `embed`, or `object`.

Value
-----

A string containing the container's type, one of `iframe`, `embed`, or `object`. If no type can be determined, `window` will be returned.

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

| Specification |
| --- |
| Long Tasks API # dom-taskattributiontiming-containertype |

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

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

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

The **`toJSON()`** method of the `TaskAttributionTiming` interface is a serializer; it returns a JSON representation of the `TaskAttributionTiming` object.

Syntax
------


```js
toJSON()
```

### Parameters

None.

### Return value

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

Examples
--------

### Using the toJSON method

In this example, calling `entry.toJSON()` returns a JSON representation of the `TaskAttributionTiming` object.


```js
const observer = new PerformanceObserver((list) => {
  list.getEntries().forEach((entry) => {
    console.log(entry.toJSON());
  });
});

observer.observe({ type: "taskattribution", buffered: true });
```


This would log a JSON object like so:


```json
{
  "name": "unknown",
  "entryType": "taskattribution",
  "startTime": 0,
  "duration": 0,
  "containerType": "window",
  "containerSrc": "",
  "containerId": "",
  "containerName": ""
}
```


To get a JSON string, you can use `JSON.stringify(entry)` directly; it will call `toJSON()` automatically.

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

| Specification |
| --- |
| Long Tasks API # dom-taskattributiontiming-tojson |

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

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

See also
--------

* `JSON`
OscillatorNode: frequency property
==================================

The **`frequency`** property of the `OscillatorNode` interface is an a-rate `AudioParam` representing the frequency of oscillation in hertz.

**Note:** though the `AudioParam` returned is read-only, the value it represents is not.

Value
-----

An a-rate `AudioParam`.

Examples
--------

The following example shows basic usage of an `AudioContext` to create an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code).


```js
// create web audio api context
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();

// create Oscillator node
const oscillator = audioCtx.createOscillator();

oscillator.type = "square";
oscillator.frequency.setValueAtTime(440, audioCtx.currentTime); // value in hertz
oscillator.start();
```

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

| Specification |
| --- |
| Web Audio API # dom-oscillatornode-frequency |

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

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

See also
--------

* Using the Web Audio API
OscillatorNode: setPeriodicWave() method
========================================

 The **`setPeriodicWave()`** method of the `OscillatorNode` interface is used to point to a `PeriodicWave`
 defining a periodic waveform that can be used to shape the oscillator's output, when
 `type` is `custom`.

Syntax
------


```js
setPeriodicWave(wave)
```

### Parameters

`wave`

 A `PeriodicWave` object representing the waveform to use as the shape
 of the oscillator's output.


### Return value

None (`undefined`).

Examples
--------

 The following example illustrates simple usage of `createPeriodicWave()`,
 recreating a sine wave from a periodic wave.


```js
const real = new Float32Array(2);
const imag = new Float32Array(2);
const ac = new AudioContext();
const osc = ac.createOscillator();

real[0] = 0;
imag[0] = 0;
real[1] = 1;
imag[1] = 0;

const wave = ac.createPeriodicWave(real, imag);

osc.setPeriodicWave(wave);

osc.connect(ac.destination);

osc.start();
osc.stop(2);
```


 This works because a sound that contains only a fundamental tone is by definition a
 sine wave.

 Here, we create a `PeriodicWave` with two values. The first value is the DC
 offset, which is the value at which the oscillator starts. 0 is good here, because we
 want to start the curve at the middle of the [-1.0; 1.0] range.

 The second and subsequent values are sine and cosine components. You can think of it as
 the result of a Fourier transform, where you get frequency domain values from time
 domain value. Here, with `createPeriodicWave()`, you specify the frequencies,
 and the browser performs an inverse Fourier transform to get a time domain buffer for
 the frequency of the oscillator. Here, we only set one component at full volume (1.0) on
 the fundamental tone, so we get a sine wave.

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

| Specification |
| --- |
| Web Audio API # dom-oscillatornode-setperiodicwave |

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

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

See also
--------

* Using the Web Audio API
* AudioContext.createPeriodicWave
OscillatorNode: OscillatorNode() constructor
============================================

 The **`OscillatorNode()`** constructor of the Web Audio API creates a new
 `OscillatorNode` object which is an `AudioNode` that
 represents a periodic waveform, like a sine wave, optionally setting the node's
 properties' values to match values in a specified object.

 If the default values of the properties are acceptable, you can optionally use the
 `BaseAudioContext.createOscillator()` factory method instead; see
 Creating an AudioNode.

Syntax
------


```js
new OscillatorNode(context, options)
```

### Parameters

`context`

A reference to an `AudioContext`.

`options` Optional

 An object whose properties specify the initial values for the oscillator node's
 properties. Any properties omitted from the object will take on the default value
 as documented.


`type`

 The shape of the wave produced by the node. Valid values are
 '`sine`', '`square`', '`sawtooth`',
 '`triangle`' and '`custom`'. The default is
 '`sine`'.


`detune`

 A detuning value (in cents) which will offset
 the `frequency` by the given amount. Its default is 0.


`frequency`

 The frequency (in hertz) of the periodic
 waveform. Its default is 440.


`periodicWave`

 An arbitrary period waveform described by a `PeriodicWave`
 object.


`channelCount`

 Represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. (See
 `AudioNode.channelCount` for more information.) Its usage and precise
 definition depend on the value of `channelCountMode`.


`channelCountMode`

 Represents an enumerated value describing the way channels must be matched between
 the node's inputs and outputs. (See `AudioNode.channelCountMode` for more
 information including default values.)


`channelInterpretation`

 Represents an enumerated value describing the meaning of the channels. This
 interpretation will define how audio up-mixing and down-mixing will happen.
 The possible values are `"speakers"` or `"discrete"`. (See
 `AudioNode.channelCountMode` for more information including default
 values.)



### Return value

A new `OscillatorNode` object instance.

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

| Specification |
| --- |
| Web Audio API # dom-oscillatornode-oscillatornode |

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

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

 The **`type`** property of the `OscillatorNode` interface specifies what shape of waveform the
 oscillator will output. There are several common waveforms available, as well as an
 option to specify a custom waveform shape. The shape of the waveform will affect the
 tone that is produced.

Value
-----

 A string specifying the shape of oscillator wave. The different
 available values are:

`sine`

A sine wave. This is the default value.

`square`

A square wave with a duty cycle of 0.5; that is, the signal is "high" for half of each period.

`sawtooth`

A sawtooth wave.

`triangle`

A triangle wave.

`custom`

 A custom waveform. You never set `type` to `custom` manually;
 instead, use the `setPeriodicWave()`
 method to provide the data representing the waveform. Doing so automatically sets the
 `type` to `custom`.


### Exceptions

`InvalidStateError` `DOMException`

 Thrown if the value `custom` was specified. To set a custom waveform, just call
 `setPeriodicWave()`. Doing so
 automatically sets the type for you.


Examples
--------

 The following example shows basic usage of an `AudioContext` to create
 an oscillator node. For an applied example, check out our Violent Theremin demo (see app.js for relevant code).


```js
// create web audio api context
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();

// create Oscillator node
const oscillator = audioCtx.createOscillator();

oscillator.type = "square";
oscillator.frequency.setValueAtTime(440, audioCtx.currentTime); // value in hertz
oscillator.start();
```

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

| Specification |
| --- |
| Web Audio API # dom-oscillatornode-type |

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

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

See also
--------

* Using the Web Audio API
OscillatorNode: detune property
===============================

The `detune` property of the `OscillatorNode` interface is an a-rate `AudioParam` representing detuning of oscillation in cents.

**Note:** though the `AudioParam` returned is read-only, the value it represents is not.

Value
-----

An a-rate `AudioParam`.

Examples
--------

The following example shows basic usage of an `AudioContext` to create an oscillator node. For applied examples/information, check out our Violent Theremin demo (see app.js for relevant code).


```js
// create web audio api context
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();

// create Oscillator node
const oscillator = audioCtx.createOscillator();

oscillator.type = "square";
oscillator.frequency.setValueAtTime(440, audioCtx.currentTime); // value in hertz
oscillator.detune.setValueAtTime(100, audioCtx.currentTime); // value in cents
oscillator.start();
```

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

| Specification |
| --- |
| Web Audio API # dom-oscillatornode-detune |

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

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

See also
--------

* Using the Web Audio API
DOMParser: DOMParser() constructor
==================================

The **`DOMParser()`** constructor creates a new `DOMParser` object. This object can be used to parse the text of a document using the `parseFromString()` method.

Syntax
------


```js
new DOMParser()
```

### Parameters

None.

### Return value

A new `DOMParser` object. This object can be used to parse the text of a document using the `parseFromString()` method.

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

| Specification |
| --- |
| HTML Standard # dom-domparser-constructor-dev |

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

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

The **`MediaElementAudioSourceNode()`** constructor creates a new `MediaElementAudioSourceNode` object instance.

Syntax
------


```js
new MediaElementAudioSourceNode(context, options)
```

### Parameters

`context`

An `AudioContext` representing the audio context you want the node to be associated with.

`options`

An object defining the properties you want the `MediaElementAudioSourceNode` to have:

`mediaElement`

An `HTMLMediaElement` that will be used as the source for the audio.

`channelCount`

 An integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. (See
 `AudioNode.channelCount` for more information.) Its usage and precise
 definition depend on the value of `channelCountMode`.


`channelCountMode`

 A string describing the way channels must be matched between
 the node's inputs and outputs. (See `AudioNode.channelCountMode` for more
 information including default values.)


`channelInterpretation`

 A string describing the meaning of the channels. This
 interpretation will define how audio up-mixing and down-mixing will happen.
 The possible values are `"speakers"` or `"discrete"`. (See
 `AudioNode.channelInterpretation` for more information including default
 values.)



### Return value

A new `MediaElementAudioSourceNode` object instance.

Examples
--------


```js
const ac = new AudioContext();
const mediaElement = document.createElement("audio");

const myAudioSource = new MediaElementAudioSourceNode(ac, {
  mediaElement,
});
```

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

| Specification |
| --- |
| Web Audio API # dom-mediaelementaudiosourcenode-mediaelementaudiosourcenode |

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

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

 The `MediaElementAudioSourceNode` interface's
 read-only **`mediaElement`** property indicates the
 `HTMLMediaElement` that contains the audio track from which the node is
 receiving audio.

 This stream was specified when the node was first created,
 either using the `MediaElementAudioSourceNode()` constructor or the
 `AudioContext.createMediaElementSource()` method.

Value
-----

 An `HTMLMediaElement` representing the element which contains the source
 of audio for the node.

Examples
--------


```js
const audioCtx = new window.AudioContext();
const audioElem = document.querySelector("audio");

let options = {
  mediaElement: audioElem,
};

let source = new MediaElementAudioSourceNode(audioCtx, options);
console.log(source.mediaElement);
```

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

| Specification |
| --- |
| Web Audio API # dom-mediaelementaudiosourcenode-mediaelement |

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

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

 The `RTCPeerConnectionIceErrorEvent` property
 **`address`** is a string which indicates the local IP address
 being used to communicate with the STUN or TURN server
 during negotiations. The error which occurred involved this address.

Value
-----

 A string which specifies the local IP address of the network
 connection to the ICE server with which negotiations were occurring when the error
 occurred. This address identifies the network interface on the local device which is
 being used to attempt to establish the connection to the remote peer.

 This can be useful on multi-homed systems—devices with more than one network
 connection—to determine which network interface is being used. For example, on a mobile
 phone, there are typically at least two network interfaces available: the cellular
 connection and a Wi-Fi connection.

 If the local IP address isn't exposed as part of a local candidate, the value of
 `address` is `null`.

Examples
--------

 This example creates a handler for
 `icecandidateerror` events
 which creates human-readable messages describing the local network interface for the
 connection as well as the ICE server that was being used to try to open the connection,
 then calls a function to display those as well as the event's
 `errorText` property's
 contents.


```js
pc.addEventListener("icecandidateerror", (event) => {
  let networkInfo = `[Local interface: ${event.address}:${event.port}`;
  let iceServerInfo = `[ICE server: ${event.url}`;

  showMessage(errorText, iceServerInfo, networkInfo);
});
```

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

| Specification |
| --- |
| WebRTC: Real-Time Communication in Browsers # dom-rtcpeerconnectioniceerrorevent-address |

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

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

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

The **`navigationType`** read-only property of the `NavigationCurrentEntryChangeEvent` interface returns the type of the navigation that resulted in the change. The property may be `null` if the change occurs due to `Navigation.updateCurrentEntry()`.

Value
-----

An enumerated value representing the type of navigation.

The possible values are:

* `push`: A new location is navigated to, causing a new entry to be pushed onto the history list.
* `reload`: The `Navigation.currentEntry` is reloaded.
* `replace`: The `Navigation.currentEntry` is replaced with a new history entry. This new entry will reuse the same `key`, but be assigned a different `id`.
* `traverse`: The browser navigates from one existing history entry to another existing history entry.
Examples
--------


```js
navigation.addEventListener("currententrychange", (event) => {
  console.log(event.navigationType);
});
```

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

| Specification |
| --- |
| HTML Standard # dom-navigationcurrententrychangeevent-navigationtype-dev |

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

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

See also
--------

* Modern client-side routing: the Navigation API
* Navigation API explainer
* Domenic Denicola's Navigation API live demo
NavigationCurrentEntryChangeEvent: from property
================================================

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

The **`from`** read-only property of the `NavigationCurrentEntryChangeEvent` interface returns the `NavigationHistoryEntry` that was navigated from.

Value
-----

A `NavigationHistoryEntry` object.

Examples
--------


```js
navigation.addEventListener("currententrychange", (event) => {
  console.log(event.from);
});
```

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

| Specification |
| --- |
| HTML Standard # dom-navigationcurrententrychangeevent-from-dev |

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

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

See also
--------

* Modern client-side routing: the Navigation API
* Navigation API explainer
* Domenic Denicola's Navigation API live demo
NavigationCurrentEntryChangeEvent: NavigationCurrentEntryChangeEvent() constructor
==================================================================================

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

The **`NavigationCurrentEntryChangeEvent()`** constructor creates a new `NavigationCurrentEntryChangeEvent` object.

Syntax
------


```js
new NavigationCurrentEntryChangeEvent(type, init)
```

### Parameters

`type`

A string representing the type of event. In the case of `NavigationCurrentEntryChangeEvent` this is always `event`.

`init`

An object containing the following properties:

`destination`

A `NavigationHistoryEntry` object representing the location being navigated to.

`navigationType` Optional

The type of the navigation that resulted in the change. Possible values are `push`, `reload`, `replace`, and `traverse`. Defaults to `null`.


Examples
--------

A developer would not use this constructor manually. A new `NavigationCurrentEntryChangeEvent` object is constructed when a handler is invoked as a result of the `currententrychange` event firing.


```js
navigation.addEventListener("currententrychange", (event) => {
  console.log(event.navigationType);
});
```

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

| Specification |
| --- |
| HTML Standard # the-navigationcurrententrychangeevent-interface |

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

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

See also
--------

* Modern client-side routing: the Navigation API
* Navigation API explainer
* Domenic Denicola's Navigation API live demo
NDEFMessage: NDEFMessage() constructor
======================================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

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

The **`NDEFMessage()`** constructor creates a new `NDEFMessage` object, initialized with the given NDEF records.

Syntax
------


```js
new NDEFMessage(records)
```

### Parameters

`records`

An array of objects with the following members:

`data` Optional

Contains the data to be transmitted; one of a string, n `ArrayBuffer`, a `TypedArray`, a `DataView`, or an array of nested records.

`encoding` Optional

A string specifying the record's encoding.

`id` Optional

A developer-defined identifier for the record.

`lang` Optional

A valid language tag according to RFC 5646: Tags for Identifying Languages (also known as BCP 47).

`mediaType` Optional

A valid MIME type.

`recordType`

A string indicating the type of data stored in `data`. It must be one of the following values:

`"absolute-url"`

An absolute URL to the data.

`"empty"`

An empty `NDEFRecord`.

`"mime"`

A valid MIME type.

`"smart-poster"`

A smart poster as defined by the NDEF-SMARTPOSTER specification.

`"text"`

Text as defined by the NDEF-TEXT specification.

`"unknown"`

The record type is not known.

`"URL"`

A URL as defined by the NDEF-URI specification.


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

| Specification |
| --- |
| Web NFC API # dom-ndefmessage-constructor |

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

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