recursal/MDN huggingface dataset:
InputDeviceCapabilities: firesTouchEvents property
==================================================

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

The **`firesTouchEvents`** read-only property of the `InputDeviceCapabilities` interface returns a boolean value that indicates whether the device dispatches touch events.

 You can use this property to detect mouse events that represent an action that may
 already have been handled by touch event handlers. This doesn't necessarily mean the
 device is a touch screen. For example, stylus and mouse devices typically generate
 touch events on mobile browsers.

Syntax
------


```js
const boolean = InputDeviceCapabilities.firesTouchEvents
```

### Returns

A `Boolean`

Example
-------


```js
myButton.addEventListener("mousedown", (e) => {
  if (!e.sourceCapabilities.firesTouchEvents) myButton.classList.add("pressed");
});
```

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

| Specification |
| --- |
| Input Device Capabilities # dom-inputdevicecapabilities-firestouchevents |

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

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

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

 The `InputDeviceCapabilities()` constructor creates a new
 `InputDeviceCapabilities` object provides information about the physical
 device responsible for generating a touch event.

Syntax
------


```js
new InputDeviceCapabilities()
new InputDeviceCapabilities(InputDeviceCapabilitiesInit)
```

### Returns

An instance of the `InputDeviceCapabilities` interface.

### Parameters

`InputDeviceCapabilitiesInit` Optional

 A dictionary object containing a set of device capabilities. It contains the
 following property.


* `fireTouchEvents`: A boolean value that indicates
 whether the device dispatches touch events.

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

| Specification |
| --- |
| Input Device Capabilities # dom-inputdevicecapabilities-constructor |

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

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

 The `lookupNamespaceURI` method looks up the namespace URI associated to the
 given namespace prefix within an XPath expression evaluated by the
 `XPathEvaluator` interface.

Syntax
------


```js
lookupNamespaceURI(prefix)
```

### Parameters

`prefix`

A string representing the prefix to look for.

### Return value

 A string representing the associated namespace URI or
 `null` if none is found.

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

#### No specification found

No specification data found for `api.XPathNSResolver.lookupNamespaceURI`.  
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.

See also
--------

* `XPathEvaluator`
* `Node.lookupNamespaceURI()`
OES\_vertex\_array\_object: isVertexArrayOES() method
=====================================================

 The **`OES_vertex_array_object.isVertexArrayOES()`** method of
 the WebGL API returns `true` if
 the passed object is a `WebGLVertexArrayObject` object.

Syntax
------


```js
isVertexArrayOES(arrayObject)
```

### Parameters

`arrayObject`

A `WebGLVertexArrayObject` (VAO) object to test.

### Return value

 A `WebGL_API.Types` indicating whether the given object is a
 `WebGLVertexArrayObject` object (`true`) or not
 (`false`).

Examples
--------


```js
const ext = gl.getExtension("OES\_vertex\_array\_object");
const vao = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao);

// …

ext.isVertexArrayOES(vao);
```

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

| Specification |
| --- |
| WebGL OES\_vertex\_array\_object 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()`
* `WebGLRenderingContext.vertexAttribPointer()`
* WebGL2 equivalent: `WebGL2RenderingContext.isVertexArray()`
OES\_vertex\_array\_object: bindVertexArrayOES() method
=======================================================

 The **`OES_vertex_array_object.bindVertexArrayOES()`** method
 of the WebGL API binds a
 passed `WebGLVertexArrayObject` object to the buffer.

Syntax
------


```js
bindVertexArrayOES(arrayObject)
```

### Parameters

`arrayObject`

A `WebGLVertexArrayObject` (VAO) object to bind.

### Return value

None (`undefined`).

Examples
--------


```js
const ext = gl.getExtension("OES\_vertex\_array\_object");
const vao = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao);

// …
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// …
```

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

| Specification |
| --- |
| WebGL OES\_vertex\_array\_object 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()`
* `WebGLRenderingContext.vertexAttribPointer()`
* WebGL2 equivalent: `WebGL2RenderingContext.bindVertexArray()`
OES\_vertex\_array\_object: deleteVertexArrayOES() method
=========================================================

 The **`OES_vertex_array_object.deleteVertexArrayOES()`** method
 of the WebGL API deletes a given
 `WebGLVertexArrayObject` object.

Syntax
------


```js
deleteVertexArrayOES(arrayObject)
```

### Parameters

`arrayObject`

A `WebGLVertexArrayObject` (VAO) object to delete.

### Return value

None (`undefined`).

Examples
--------


```js
const ext = gl.getExtension("OES\_vertex\_array\_object");
const vao = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao);

// …

ext.deleteVertexArrayOES(vao);
```

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

| Specification |
| --- |
| WebGL OES\_vertex\_array\_object 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()`
* `WebGLRenderingContext.vertexAttribPointer()`
* WebGL2 equivalent: `WebGL2RenderingContext.deleteVertexArray()`
OES\_vertex\_array\_object: createVertexArrayOES() method
=========================================================

 The **`OES_vertex_array_object.createVertexArrayOES()`** method
 of the WebGL API creates and initializes a
 `WebGLVertexArrayObject` object that represents a vertex array object (VAO)
 pointing to vertex array data and which provides names for different sets of vertex
 data.

Syntax
------


```js
createVertexArrayOES()
```

### Parameters

None.

### Return value

 A `WebGLVertexArrayObject` representing a vertex array object (VAO) which
 points to vertex array data.

Examples
--------


```js
const ext = gl.getExtension("OES\_vertex\_array\_object");
const vao = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao);

// …
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// …
```

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

| Specification |
| --- |
| WebGL OES\_vertex\_array\_object 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()`
* `WebGLRenderingContext.vertexAttribPointer()`
* WebGL2 equivalent: `WebGL2RenderingContext.createVertexArray()`
AbstractRange: startOffset property
===================================

The read-only **`startOffset`** property of the `AbstractRange` interface returns the offset into the start node of the range's start position.

Value
-----

An integer value indicating the number of characters into the `Node` indicated by `startContainer` at which the first character of the range is located.

Example
-------


```js
let startOffset = range.startOffset;
```

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

| Specification |
| --- |
| DOM Standard # ref-for-dom-range-startoffset① |

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

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

The read-only **`endContainer`** property of the `AbstractRange` interface returns the `Node` in which the end of the range is located.

Value
-----

The `Node` which contains the last character of the range.

Example
-------


```js
let endNode = range.endContainer;
```

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

| Specification |
| --- |
| DOM Standard # ref-for-dom-range-endcontainer① |

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

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

The read-only **`startContainer`** property of the `AbstractRange` interface returns the start `Node` for the range.

Value
-----

The `Node` inside which the start position of the range is found.

Example
-------


```js
let startNode = range.startContainer;
```

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

| Specification |
| --- |
| DOM Standard # ref-for-dom-range-startcontainer① |

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

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

The read-only **`collapsed`** property of the `AbstractRange` interface returns `true` if the range's start position and end position are the same.

Value
-----

A boolean value which is `true` if the range is *collapsed*. A collapsed range is one in which the start and end positions are the same, resulting in a zero-character-long range.

Example
-------


```js
let isCollapsed = range.collapsed;
```

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

| Specification |
| --- |
| DOM Standard # ref-for-dom-range-collapsed① |

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

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

The **`endOffset`** property of the `AbstractRange` interface returns the offset into the end node of the range's end position.

Value
-----

An integer value indicating the number of characters into the `Node` indicated by `endContainer` at which the final character of the range is located.

Example
-------


```js
let endOffset = range.endOffset;
```

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

| Specification |
| --- |
| DOM Standard # ref-for-dom-range-endoffset① |

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

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

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

 The **`locks`** read-only property of
 the `WorkerNavigator` interface returns a `LockManager`
 object which provides methods for requesting a new `Lock` object and
 querying for an existing `Lock` object.

Value
-----

A `LockManager` object.

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

| Specification |
| --- |
| Web Locks API # dom-navigatorlocks-locks |

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

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

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

 The value of the **`WorkerNavigator.appCodeName`** property is
 always "`Mozilla`", in any browser. This property is kept only for
 compatibility purposes.


**Note:** Do not rely on this property to return a real
 product name. All browsers return "`Mozilla`" as the value of this property.


Value
-----

The string "`Mozilla`".

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

| Specification |
| --- |
| HTML Standard # dom-navigator-appcodename-dev |

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

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

See also
--------

* `WorkerNavigator.appName`
* `WorkerNavigator.product`
WorkerNavigator: setAppBadge() method
=====================================

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

The **`setAppBadge()`** method of the `WorkerNavigator` interface sets a badge on the icon associated with this app. If a value is passed to the method, this will be set as the value of the badge. Otherwise the badge will display as a dot, or other indicator as defined by the platform.

Syntax
------


```js
setAppBadge()
setAppBadge(contents)
```

### Parameters

`contents` Optional

A `number` which will be used as the value of the badge. If `contents` is `0` then the badge will be set to `nothing`, indicating a cleared badge.

### Return value

A `Promise` that resolves with `undefined`.

### Exceptions

`InvalidStateError` `DOMException`

Thrown if the document is not fully active.

`SecurityError` `DOMException`

Thrown if the call was blocked by the same-origin policy.

`NotAllowedError` `DOMException`

Thrown if `PermissionStatus.state` is not `granted`.

Examples
--------

In the example below an unread count is passed to `setAppBadge()`. The badge should then display `30`.


```js
const unread = 30;
navigator.setAppBadge(unread);
```

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

#### No specification found

No specification data found for `api.WorkerNavigator.setAppBadge`.  
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.

See also
--------

* Badging for app icons
WorkerNavigator: permissions property
=====================================

 The **`WorkerNavigator.permissions`** read-only property
 returns a `Permissions` object that can be used to query and update
 permission status of APIs covered by the Permissions API.

Value
-----

A `Permissions` object.

Examples
--------


```js
navigator.permissions.query({ name: "notifications" }).then((result) => {
  if (result.state === "granted") {
    showNotification();
  } else if (result.state === "prompt") {
    requestNotificationPermission();
  }
});
```

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

| Specification |
| --- |
| Permissions # dom-workernavigator-permissions |

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

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

See also
--------

* Permissions API
* Web Worker API
WorkerNavigator: serial property
================================

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

The **`serial`** read-only property of the `WorkerNavigator` interface returns a `Serial` object which represents the entry point into the `Web Serial API`.

When getting, the same instance of the `Serial` object will always be returned.

Value
-----

A `Serial` object.

Examples
--------

The following example uses the `getPorts()` method to initialize a list of available ports.


```js
navigator.serial.getPorts().then((ports) => {
  // Initialize the list of available ports.
});
```

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

| Specification |
| --- |
| Web Serial API # dom-workernavigator-serial |

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

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

See also
--------

* Read from and write to a serial port
* Getting started with the web serial API
WorkerNavigator: deviceMemory property
======================================

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

 The **`deviceMemory`** read-only
 property of the `WorkerNavigator` interface returns the approximate amount of
 device memory in gigabytes.

 The reported value is imprecise to curtail fingerprinting. It's approximated by
 rounding down to the nearest power of 2, then dividing that number by 1024. It is then
 clamped within lower and upper bounds to protect the privacy of owners of very low-memory or
 high-memory devices.

Value
-----

A floating point number; one of `0.25`, `0.5`, `1`, `2`, `4`, `8`.

Examples
--------

The following code can be run in a worker:


```js
const memory = navigator.deviceMemory;
console.log(`This device has at least ${memory}GiB of RAM.`);
```

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

| Specification |
| --- |
| Device Memory # sec-device-memory-js-api |

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

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

See also
--------

* `Device-Memory` HTTP header
WorkerNavigator: globalPrivacyControl property
==============================================

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

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

 The **`WorkerNavigator.globalPrivacyControl`** read-only property returns the user's Global Privacy Control setting for the current website.
 This setting indicates whether the user consents to the website or service selling or sharing their personal information with third parties.

The value of the property reflects that of the `Sec-GPC` HTTP header.

Value
-----

`true` if the user explicitly *does not* grant consent to sell or share their data.
 `false` if the user either grants consent, or has not indicated a preference.

Example
-------


```js
console.log(navigator.globalPrivacyControl);
// "true" if the user has specifically indicated they do not want their data shared or sold, otherwise "false".
```

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

#### No specification found

No specification data found for `api.WorkerNavigator.globalPrivacyControl`.  
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.

See also
--------

* `Sec-GPC` header
* globalprivacycontrol.org
* Global Privacy Control Spec
* Do Not Track on Wikipedia
WorkerNavigator: userAgentData property
=======================================

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

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

 The **`userAgentData`** read-only property of the `WorkerNavigator` interface returns an `NavigatorUAData` object
 which can be used to access the `User-Agent Client Hints API`.

Value
-----

A `NavigatorUAData` object.

Examples
--------

The following example prints the value of `NavigatorUAData.brands` to the console.


```js
console.log(navigator.userAgentData.brands);
```

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

| Specification |
| --- |
| User-Agent Client Hints # dom-navigatorua-useragentdata |

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

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

See also
--------

* Improving user privacy and developer experience with User-Agent Client Hints
WorkerNavigator: usb 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
The **`usb`** read-only property of the `WorkerNavigator` interface returns a `USB` object for the current document, providing access to WebUSB API functionality.

Value
-----

A `USB` object.

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

| Specification |
| --- |
| WebUSB API # dom-workernavigator-usb |

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

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

See also
--------

* WebUSB API
WorkerNavigator: gpu property
=============================

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

The **`gpu`** read-only property of the `WorkerNavigator` interface returns the `GPU` object for the current worker context, which is the entry point for the WebGPU API.

Value
-----

A `GPU` object.

Examples
--------


```js
// Can be run inside a web worker
async function init() {
  if (!navigator.gpu) {
    throw Error("WebGPU not supported.");
  }

  const adapter = await navigator.gpu.requestAdapter();
  if (!adapter) {
    throw Error("Couldn't request WebGPU adapter.");
  }

  const device = await adapter.requestDevice();

  //...
}
```

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

| Specification |
| --- |
| WebGPU # navigator-gpu |

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

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

See also
--------

* WebGPU API