recursal/MDN huggingface dataset:
SharedWorkerGlobalScope
=======================

The **`SharedWorkerGlobalScope`** object (the `SharedWorker` global scope) is accessible through the `self` keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See the complete list of functions available to workers.

EventTarget

WorkerGlobalScope

SharedWorkerGlobalScopeInstance properties
-------------------

*This interface inherits properties from the `WorkerGlobalScope` interface, and its parent `EventTarget`.*

`SharedWorkerGlobalScope.name` Read only 

The name that the `SharedWorker` was (optionally) given when it was created using the `SharedWorker()` constructor. This is mainly useful for debugging purposes.

Instance methods
----------------

*This interface inherits methods from the `WorkerGlobalScope` interface, and its parent `EventTarget`.*

`SharedWorkerGlobalScope.close()`

Discards any tasks queued in the `SharedWorkerGlobalScope`'s event loop, effectively closing this particular scope.

Events
------

Listen to this event using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface.

`connect`

Fired on shared workers when a new client connects.

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

| Specification |
| --- |
| HTML Standard # shared-workers-and-the-sharedworkerglobalscope-interface |

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

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

See also
--------

* `SharedWorker`
* `WorkerGlobalScope`
* Using Web workers
* Functions available to workers
FileSystemFileEntry
===================

The **`FileSystemFileEntry`** interface of the File and Directory Entries API represents a file in a file system. It offers properties describing the file's attributes, as well as the `file()` method, which creates a `File` object that can be used to read the file.

FileSystemEntry

FileSystemFileEntryInstance properties
-------------------

*Inherits the properties of its parent interface, `FileSystemEntry`, but has no properties unique to this interface.*

Instance methods
----------------

`file()`

Creates a new `File` object which can be used to read the file.

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

| Specification |
| --- |
| File and Directory Entries API # api-fileentry |

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

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

See also
--------

* File and Directory Entries API
* Introduction to the File and Directory Entries API
HIDInputReportEvent
===================

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.

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

The **`HIDInputReportEvent`** interface of the `WebHID API` is passed to `HIDDevice.inputreport_event` when an input report is received from any associated HID device.

Event

HIDInputReportEventInstance properties
-------------------

*This interface also inherits properties from `Event`.*

`HIDInputReportEvent.data` Read only  
Experimental

A `DataView` containing the data from the input report, excluding the `reportId` if the HID interface uses report IDs.

`HIDInputReportEvent.device` Read only  
Experimental

The `HIDDevice` instance that represents the HID interface that sent the input report.

`HIDInputReportEvent.reportId` Read only  
Experimental

The one-byte identification prefix for this report, or 0 if the HID interface does not use report IDs.

Instance methods
----------------

*This interface inherits methods from its parent, `Event`.*

Examples
--------

The following example demonstrates listening for an `inputReport` that will allow the application to detect which button is pressed on a Joy-Con Right device. You can see more examples, and live demos in the article Connecting to uncommon HID devices.


```js
device.addEventListener("inputreport", (event) => {
  const { data, device, reportId } = event;

  // Handle only the Joy-Con Right device and a specific report ID.
  if (device.productId !== 0x2007 && reportId !== 0x3f) return;

  const value = data.getUint8(0);
  if (value === 0) return;

  const someButtons = { 1: "A", 2: "X", 4: "B", 8: "Y" };
  console.log(`User pressed button ${someButtons[value]}.`);
});
```

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

| Specification |
| --- |
| WebHID API # dom-hidinputreportevent |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
EXT\_texture\_filter\_anisotropic extension
===========================================

The **`EXT_texture_filter_anisotropic`** extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF).

AF improves the quality of mipmapped texture access when viewing a textured primitive at an oblique angle. Using just mipmapping, these lookups have a tendency to average to grey.

WebGL extensions are available using the `WebGLRenderingContext.getExtension()` method. For more information, see also Using Extensions in the WebGL tutorial.

**Note:** This extension is available to both, WebGL1 and WebGL2 contexts.

Constants
---------

`ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT`

This is the `pname` argument to the `gl.getParameter()` call, and it returns the maximum available anisotropy.

`ext.TEXTURE_MAX_ANISOTROPY_EXT`

This is the `pname` argument to the `gl.getTexParameter()` and `gl.texParameterf()` / `gl.texParameteri()` calls and sets the desired maximum anisotropy for a texture.

Examples
--------


```js
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE\_2D, texture);
const ext =
  gl.getExtension("EXT\_texture\_filter\_anisotropic") ||
  gl.getExtension("MOZ\_EXT\_texture\_filter\_anisotropic") ||
  gl.getExtension("WEBKIT\_EXT\_texture\_filter\_anisotropic");
if (ext) {
  const max = gl.getParameter(ext.MAX\_TEXTURE\_MAX\_ANISOTROPY\_EXT);
  gl.texParameterf(gl.TEXTURE\_2D, ext.TEXTURE\_MAX\_ANISOTROPY\_EXT, max);
}
```

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

| Specification |
| --- |
| WebGL EXT\_texture\_filter\_anisotropic Khronos Ratified Extension Specification  |

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

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

See also
--------

* `WebGLRenderingContext.getExtension()`
CaptureController
=================

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

The **`CaptureController`** interface provides methods that can be used to further manipulate a capture session separate from its initiation via `MediaDevices.getDisplayMedia()`.

A `CaptureController` object is associated with a capture session by passing it into a `getDisplayMedia()` call as the value of the options object's `controller` property.

Constructor
-----------

`CaptureController()` 
Experimental

Creates a new `CaptureController` object instance.

Instance methods
----------------

`setFocusBehavior()` 
Experimental

Controls whether the captured tab or window will be focused or whether the focus will remain with the tab containing the capturing app.

Examples
--------


```js
// Create a new CaptureController instance
const controller = new CaptureController();

// Prompt the user to share a tab, window, or screen.
const stream = await navigator.mediaDevices.getDisplayMedia({ controller });

// Query the displaySurface value of the captured video track
const [track] = stream.getVideoTracks();
const displaySurface = track.getSettings().displaySurface;

if (displaySurface == "browser") {
  // Focus the captured tab.
  controller.setFocusBehavior("focus-captured-surface");
} else if (displaySurface == "window") {
  // Do not move focus to the captured window.
  // Keep the capturing page focused.
  controller.setFocusBehavior("no-focus-change");
}
```

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

| Specification |
| --- |
| Screen Capture # dom-capturecontroller |

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

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

See also
--------

* Screen Capture API
* `MediaDevices.getDisplayMedia()`
* Better screen sharing with Conditional Focus
SVGFEFuncGElement
=================

The **`SVGFEFuncGElement`** interface corresponds to the `<feFuncG>` element.

EventTarget

Node

Element

SVGElement

SVGComponentTransferFunctionElement

SVGFEFuncGElementInstance properties
-------------------

*This interface not provide any specific properties, but inherits properties from its parent interface, `SVGComponentTransferFunctionElement`.*

Instance methods
----------------

*This interface does not provide any specific methods, but implements those of its parent, `SVGComponentTransferFunctionElement`.*

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

| Specification |
| --- |
| Filter Effects Module Level 1 # InterfaceSVGFEFuncGElement |

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

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

See also
--------

* `<feFuncG>`
SVGUseElement
=============

SVG use DOM interface
---------------------

The **`SVGUseElement`** interface corresponds to the `<use>` element.

EventTarget

Node

Element

SVGElement

SVGGraphicsElement

SVGUseElementInstance properties
-------------------

*This interface also inherits properties from its parent interface, `SVGGraphicsElement`.*

`SVGUseElement.href` Read only 

An `SVGAnimatedString` corresponding to the `href` or `xlink:href` 
Deprecated
 attribute of the given element.

`SVGUseElement.x` Read only 

An `SVGAnimatedLength` corresponding to the `x` attribute of the given element.

`SVGUseElement.y` Read only 

An `SVGAnimatedLength` corresponding to the `y` attribute of the given element.

`SVGUseElement.width` Read only 

An `SVGAnimatedLength` corresponding to the `width` attribute of the given element.

`SVGUseElement.height` Read only 

An `SVGAnimatedLength` corresponding to the `height` attribute of the given element.

Instance methods
----------------

*This interface doesn't implement any specific methods, but inherits methods from its parent interface, `SVGGraphicsElement`.*

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

| Specification |
| --- |
| Scalable Vector Graphics (SVG) 2 # InterfaceSVGUseElement |

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

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

See also
--------

* `<use>`
PerformanceMark
===============

**`PerformanceMark`** is an interface for `PerformanceEntry` objects with an `entryType` of "`mark`".

Entries of this type are typically created by calling `performance.mark()` to add a *named* `DOMHighResTimeStamp` (the *mark*) to the browser's performance timeline. To create a performance mark that isn't added to the browser's performance timeline, use the constructor.

PerformanceEntry

PerformanceMark

**Note:** This feature is available in Web Workers

Constructor
-----------

`PerformanceMark()`

Creates a new `PerformanceMark` object that isn't added to the browser's performance timeline.

Instance properties
-------------------

This interface extends the following `PerformanceEntry` properties by qualifying/constraining the properties as follows:

`PerformanceEntry.entryType` Read only 

Returns "`mark`".

`PerformanceEntry.name` Read only 

Returns the name given to the mark when it was created via a call to `performance.mark()`.

`PerformanceEntry.startTime` Read only 

Returns the `DOMHighResTimeStamp` when `performance.mark()` was called.

`PerformanceEntry.duration` Read only 

Returns "`0`". (A mark has no *duration*.)

This interface also supports the following properties:

`PerformanceMark.detail` Read only 

Returns arbitrary metadata that has been included in the mark upon construction.

Instance methods
----------------

This interface has no methods.

Example
-------

See the example in Using the User Timing API.

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

| Specification |
| --- |
| User Timing # performancemark |

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

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

See also
--------

* User Timing (Overview)
* Using the User Timing API
AudioDestinationNode
====================

The `AudioDestinationNode` interface represents the end destination of an audio graph in a given context — usually the speakers of your device. It can also be the node that will "record" the audio data when used with an `OfflineAudioContext`.

`AudioDestinationNode` has no output (as it *is* the output, no more `AudioNode` can be linked after it in the audio graph) and one input. The number of channels in the input must be between `0` and the `maxChannelCount` value or an exception is raised.

The `AudioDestinationNode` of a given `AudioContext` can be retrieved using the `AudioContext.destination` property.

EventTarget

AudioNode

AudioDestinationNode

|  |  |
| --- | --- |
| Number of inputs | `1` |
| Number of outputs | `0` |
| Channel count mode | `"explicit"` |
| Channel count | `2` |
| Channel interpretation | `"speakers"` |

Instance properties
-------------------

*Inherits properties from its parent, `AudioNode`*.

`AudioDestinationNode.maxChannelCount`

An `unsigned long` defining the maximum number of channels that the physical device can handle.

Instance methods
----------------

*No specific method; inherits methods from its parent, `AudioNode`*.

Example
-------

There is no complex set up for using an `AudioDestinationNode` — by default, this represents the output of the user's system (e.g. their speakers), so you can get it hooked up inside an audio graph using only a few lines of code:


```js
const audioCtx = new AudioContext();
const source = audioCtx.createMediaElementSource(myMediaElement);
source.connect(gainNode);
gainNode.connect(audioCtx.destination);
```


To see a more complete implementation, check out one of our MDN Web Audio examples, such as Voice-change-o-matic or Violent Theremin.

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

| Specification |
| --- |
| Web Audio API # AudioDestinationNode |

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

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

See also
--------

* Using the Web Audio API
CanvasGradient
==============

The **`CanvasGradient`** interface represents an opaque object describing a gradient. It is returned by the methods `CanvasRenderingContext2D.createLinearGradient()`, `CanvasRenderingContext2D.createConicGradient()` or `CanvasRenderingContext2D.createRadialGradient()`.

It can be used as a `fillStyle` or `strokeStyle`.

Instance properties
-------------------

*As an opaque object, there is no exposed property.*

Instance methods
----------------

`CanvasGradient.addColorStop()`

Adds a new stop, defined by an `offset` and a `color`, to the gradient.

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

| Specification |
| --- |
| HTML Standard # canvasgradient |

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

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

See also
--------

* Creator methods in `CanvasRenderingContext2D`.
* The `<canvas>` element and its associated interface, `HTMLCanvasElement`.
VideoTrack
==========

The `VideoTrack` interface represents a single video track from a `<video>` element.

The most common use for accessing a `VideoTrack` object is to toggle its `selected` property in order to make it the active video track for its `<video>` element.

Instance properties
-------------------

`selected`

A Boolean value which controls whether or not the video track is active. Only a single video track can be active at any given time, so setting this property to `true` for one track while another track is active will make that other track inactive.

`id` Read only 

A string which uniquely identifies the track within the media. This ID can be used to locate a specific track within a video track list by calling `VideoTrackList.getTrackById()`. The ID can also be used as the fragment part of the URL if the media supports seeking by media fragment per the Media Fragments URI specification.

`kind` Read only 

A string specifying the category into which the track falls. For example, the main video track would have a `kind` of `"main"`.

`label` Read only 

A string providing a human-readable label for the track. For example, a track whose `kind` is `"sign"` might have a `label` of `"A sign-language interpretation"`. This string is empty if no label is provided.

`language` Read only 

A string specifying the video track's primary language, or an empty string if unknown. The language is specified as a BCP 47 (RFC 5646) language code, such as `"en-US"` or `"pt-BR"`.

`sourceBuffer` Read only 

The `SourceBuffer` that created the track. Returns null if the track was not created by a `SourceBuffer` or the `SourceBuffer` has been removed from the `MediaSource.sourceBuffers` attribute of its parent media source.

Usage notes
-----------

To get a `VideoTrack` for a given media element, use the element's `videoTracks` property, which returns a `VideoTrackList` object from which you can get the individual tracks contained in the media:


```js
const el = document.querySelector("video");
const tracks = el.videoTracks;
```


You can then access the media's individual tracks using either array syntax or functions such as `forEach()`.

This first example gets the first video track on the media:


```js
const firstTrack = tracks[0];
```


The next example scans through all of the media's video tracks, activating the first video track that is in the user's preferred language (taken from a variable `userLanguage`).


```js
for (const track of tracks) {
  if (track.language === userLanguage) {
    track.selected = true;
    break;
  }
}
```


The `language` is in standard (RFC 5646) format. For US English, this would be `"en-US"`, for example.

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

| Specification |
| --- |
| HTML Standard # videotrack |

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

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

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

The **`NavigationTransition`** interface of the Navigation API represents an ongoing navigation, that is, a navigation that hasn't yet reached the `navigatesuccess` or `navigateerror` stage.

It is accessed via the `Navigation.transition` property.

Instance properties
-------------------

`finished` Read only  
Experimental

Returns a `Promise` that fulfills at the same time the `navigatesuccess` event fires, or rejects at the same time the `navigateerror` event fires.

`from` Read only  
Experimental

Returns the `NavigationHistoryEntry` that the transition is coming from.

`navigationType` Read only  
Experimental

Returns the type of the ongoing navigation.

Examples
--------


```js
async function cleanupNavigation() {
  await navigation.transition.finished;
  // Navigation has completed successfully
  // Cleanup any ongoing monitoring
}
```

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

| Specification |
| --- |
| HTML Standard # navigationtransition |

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
ReportBody
==========

The **`ReportBody`** interface of the Reporting API represents the body of a report. Individual report types inherit from this interface, adding specific attributes relevant to the particular report.

### Reports that inherit from `ReportBody`

* `CSPViolationReportBody`
* `DeprecationReportBody`
* `InterventionReportBody`

An instance of `ReportBody` is returned as the value of `Report.body`. The interface has no constructor.

Instance methods
----------------

`ReportBody.toJSON()`

A *serializer* which returns a JSON representation of the `ReportBody` object.

Examples
--------

In this example we create a new `ReportingObserver` to observe intervention reports. The `InterventionReportBody` interface inherits from `ReportBody`.


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

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

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

| Specification |
| --- |
| Reporting API # reportbody |

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

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

The **`IIRFilterNode`** interface of the Web Audio API is a `AudioNode` processor which implements a general **infinite impulse response** (IIR) filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. It lets the parameters of the filter response be specified, so that it can be tuned as needed.

EventTarget

AudioNode

IIRFilterNode

|  |  |
| --- | --- |
| Number of inputs | `1` |
| Number of outputs | `1` |
| Channel count mode | `"max"` |
| Channel count | Same as on the input |
| Channel interpretation | `"speakers"` |

Typically, it's best to use the `BiquadFilterNode` interface to implement higher-order filters. There are several reasons why:

* Biquad filters are typically less sensitive to numeric quirks.
* The filter parameters of biquad filters can be automated.
* All even-ordered IIR filters can be created using `BiquadFilterNode`.

However, if you need to create an odd-ordered IIR filter, you'll need to use `IIRFilterNode`. You may also find this interface useful if you don't need automation, or for other reasons.

**Note:** Once the node has been created, you can't change its coefficients.

`IIRFilterNode`s have a tail-time reference; they continue to output non-silent audio with zero input. As an IIR filter, the non-zero input continues forever, but this can be limited after some finite time in practice, when the output has approached zero closely enough. The actual time that takes depends on the filter coefficients provided.

Constructor
-----------

`IIRFilterNode()`

Creates a new instance of an IIRFilterNode object.

Instance properties
-------------------

*This interface has no properties of its own; however, it inherits properties from its parent, `AudioNode`*.

Instance methods
----------------

*Inherits methods from its parent, `AudioNode`. It also has the following additional methods:*

`getFrequencyResponse()`

Uses the filter's current parameter settings to calculate the response for frequencies specified in the provided array of frequencies.

Examples
--------

You can find a simple IIR filter demo live on Codepen. Also see the source code on GitHub. It includes some different coefficient values for different lowpass frequencies — you can change the value of the `filterNumber` constant to a value between 0 and 3 to check out the different available effects.

Also see our Using IIR filters guide for a full explanation.

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

| Specification |
| --- |
| Web Audio API # IIRFilterNode |

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

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

See also
--------

* Using the Web Audio API
* `AudioNode`
* `BiquadFilterNode`