recursal/MDN huggingface dataset:
LargestContentfulPaint: element property
========================================

The **`element`** read-only property of the `LargestContentfulPaint` interface returns an object representing the `Element` that is the largest contentful paint.

Value
-----

An `Element`.

Examples
--------

### Logging the largest contentful paint element

This example uses a `PerformanceObserver` notifying of new `largest-contentful-paint` performance entries as they are recorded in the browser's performance timeline. The `buffered` option is used to access entries from before the observer creation.


```js
const observer = new PerformanceObserver((list) => {
  const entries = list.getEntries();
  const lastEntry = entries[entries.length - 1]; // Use the latest LCP candidate
  console.log(lastEntry.element);
});
observer.observe({ type: "largest-contentful-paint", buffered: true });
```

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

| Specification |
| --- |
| Largest Contentful Paint # dom-largestcontentfulpaint-element |

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

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

 The read-only **`media`** property of the
 `CSSImportRule` interface returns a `MediaList` object,
 containing the value of the `media` attribute of the associated stylesheet.

Value
-----

Returns a `MediaList` object.

The value of `media` can be set by passing a string containing the `media` attribute; for example `"print"`.

Examples
--------

### Getting the media property

 The following stylesheet includes a single `@import` rule. Therefore the
 first item in the list of CSS rules will be a `CSSImportRule`. The
 `media` property returns a `MediaList` object. This includes
 the `mediaText` property with a value of `screen`.


```css
@import url("style.css") screen;
```



```js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].media); //returns a MediaList
```

### Setting the media property

To change the `media` attribute of the associated stylesheet, set the value of `media` to a string containing the new value.


```js
let myRules = document.styleSheets[0].cssRules;
myRules[0].media = "print";
```

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

| Specification |
| --- |
| CSS Object Model (CSSOM) # dom-cssimportrule-media |

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

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

The read-only **`supportsText`** property of the `CSSImportRule` interface returns the supports condition specified by the `@import` at-rule.

Value
-----

A string, or `null`.

Examples
--------

The document's single stylesheet contains three `@import` rules. The first declaration imports a stylesheet if `display: flex` is supported. The second declaration imports a stylesheet if the `:has` selector is supported. The third declaration imports a stylesheet without a supports condition.

The `supportsText` property returns the import conditions associated with the at-rule.


```css
@import url("style1.css") supports(display: flex);
@import url("style2.css") supports(selector(p:has(a)));
@import url("style3.css");
```



```js
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].supportsText); // returns `"display: flex"`
console.log(myRules[1].supportsText); // returns `"selector(p:has(a))"`
console.log(myRules[2].supportsText); // returns `null`
```

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

| Specification |
| --- |
| CSS Object Model (CSSOM) # dom-cssimportrule-supportstext |

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

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

See also
--------

* Using feature queries
* `@import` and `@supports`
CSSImportRule: stylesheet property
==================================

 The read-only **`styleSheet`** property of the
 `CSSImportRule` interface returns the CSS Stylesheet specified by the
 `@import` at-rule. This will be
 in the form of a `CSSStyleSheet` object.

 An `@import` at-rule always has
 an associated stylesheet.

Value
-----

A `CSSStyleSheet`.

Examples
--------

 The following stylesheet includes a single `@import` rule. Therefore the
 first item in the list of CSS rules will be a `CSSImportRule`. The
 `styleSheet` property returns the imported stylesheet.


```css
@import url("style.css") screen;
```



```js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].styleSheet); //returns a CSSStyleSheet object
```

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

| Specification |
| --- |
| CSS Object Model (CSSOM) # dom-cssimportrule-stylesheet |

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

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

 The read-only **`href`** property of the
 `CSSImportRule` interface returns the URL specified by the
 `@import` at-rule.

 The resolved URL will be the `href` attribute of the
 associated stylesheet.

Value
-----

A string.

Examples
--------

 The following stylesheet includes a single `@import` rule. Therefore the
 first item in the list of CSS rules will be a `CSSImportRule`. The
 `href` property returns the URL of the imported stylesheet.


```css
@import url("style.css") screen;
```



```js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].href); //returns style.css
```

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

| Specification |
| --- |
| CSS Object Model (CSSOM) # dom-cssimportrule-href |

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

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

Baseline 2022
-------------

Newly availableSince March 2022, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

* Learn more
* See full compatibility
* Report feedback
The read-only **`layerName`** property of the `CSSImportRule` interface returns the name of the cascade layer created by the `@import` at-rule.

 If the created layer is anonymous, the string is empty (`""`), if no layer has been
 created, it is the `null` object.

Value
-----

A string, that can be empty, or the `null` object.

Examples
--------

The document's single stylesheet contains three `@import` rules. The first declaration imports a stylesheet into a named layer. The second declaration imports a stylesheet into an anonymous layer. The third declaration imports a stylesheet without a layer declaration.

 The `layerName` property returns the name of the layer associated with the imported
 stylesheet.


```css
@import url("style1.css") layer(layer-1);
@import url("style2.css") layer;
@import url("style3.css");
```



```js
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].layerName); // returns `"layer-1"`
console.log(myRules[1].layerName); // returns `""` (an anonymous layer)
console.log(myRules[2].layerName); // returns `null`
```

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

| Specification |
| --- |
| CSS Object Model (CSSOM) # dom-cssimportrule-layername |

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

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

See also
--------

* Learning area : Cascade layers
* `@import` and `@layer`
USBDevice: deviceSubclass 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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`deviceSubclass`** read only property of the
 `USBDevice` interface one of three properties that identify USB devices for
 the purpose of loading a USB driver that will work with that device. The other two
 properties are USBDevice.deviceClass and USBDevice.deviceProtocol.

Value
-----

A number.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-devicesubclass |

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

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

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

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

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`claimInterface()`** method of the
 `USBDevice` interface returns a `promise` that resolves when
 the requested interface is claimed for exclusive access.

Syntax
------


```js
claimInterface(interfaceNumber)
```

### Parameters

`interfaceNumber`

 The index of one of the interfaces supported by the device. Interfaces are
 device specific.


### Return value

A `promise`.

Examples
--------

 The following example shows `claimInterface()` in the context of connecting
 to a USB device.


```js
async function connectDevice(usbDevice) {
  await usbDevice.open();
  if (usbDevice.configuration === null) await usbDevice.selectConfiguration(1);
  await usbDevice.claimInterface(0);
}
```

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-claiminterface② |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: deviceProtocol 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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`deviceProtocol`** read only property of the
 `USBDevice` interface one of three properties that identify USB devices for
 the purpose of loading a USB driver that will work with that device. The other two
 properties are `USBDevice.deviceClass`
 and `USBDevice.deviceSubclass`.

Value
-----

A number.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-deviceprotocol |

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

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

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

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

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`transferIn()`** method of the `USBDevice`
 interface returns a `promise` that resolves with a
 `USBInTransferResult` when bulk or interrupt data is received from the USB
 device.

Syntax
------


```js
transferIn(endpointNumber, length)
```

### Parameters

`endpointNumber`

The number of a device-specific endpoint (buffer).

`length`

 The maximum number of bytes that will be read back from the device. The actual data
 is in the `USBInTransferResult` in the resolved Promise.


### Return value

A `promise` that resolves with a `USBInTransferResult`.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-transferin① |

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

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

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

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

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`isochronousTransferIn()`** method of the `USBDevice` interface returns a `Promise` that resolves with a `USBIsochronousInTransferResult` when time sensitive information has been transmitted to (received by) the USB device.

Syntax
------


```js
isochronousTransferIn(endpointNumber, packetLengths)
```

### Parameters

`endpointNumber`

The number of a device-specific endpoint (buffer).

`packetLengths`

An array of lengths for the packets being received.

### Return value

A `Promise` that resolves with a `USBIsochronousInTransferResult`.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-isochronoustransferin |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: productName 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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`productName`** read only property of the
 `USBDevice` interface the manufacturer-defined name that identifies a USB
 device.

Value
-----

The manufacturer-defined name that identifies a USB device.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-productname |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: usbVersionSubminor 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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`usbVersionSubminor`** read only property of the
 `USBDevice` interface is one of three properties that declare the USB
 protocol version supported by the device. The other two properties
 are USBDevice.usbVersionMajor and USBDevice.usbVersionMinor.

Value
-----

 The first of three properties that declare the USB protocol version supported by the
 device.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-usbversionsubminor |

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

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

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

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

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`close()`** method of the `USBDevice`
 interface returns a `promise` that resolves when all open interfaces are
 released and the device session has ended.

Syntax
------


```js
close()
```

### Parameters

None.

### Return value

A `promise`.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-close |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: configuration 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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`configuration`** read only property of the
 `USBDevice` interface returns a `USBConfiguration` object for
 the currently selected interface for a paired USB device.

Value
-----

A `USBConfiguration` object.

Examples
--------

 The following example uses this property to test for the existence of a
 USBConfiguration property to select a configuration before claiming an interface.


```js
async function connectDevice(usbDevice) {
  await usbDevice.open();
  if (usbDevice.configuration === null) await usbDevice.selectConfiguration(1);
  await usbDevice.claimInterface(0);
}
```

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-configuration① |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: serialNumber 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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`serialNumber`** read only property of the
 `USBDevice` interface is the manufacturer-defined serial number for the
 specific USB device.

Value
-----

The serial number for the specified USB device

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-serialnumber |

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

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

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

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

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`reset()`** method of the `USBDevice`
 interface returns a `promise` that resolves when the device is reset and all
 app operations canceled and their promises rejected.

Syntax
------


```js
reset()
```

### Parameters

None.

### Return value

A `promise`.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-reset |

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

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

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

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

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`forget()`** method of the `USBDevice` interface returns a `Promise` that resolves when all pending operations are aborted, all open interfaces are released, the device session has ended, and the permission is reset.

Syntax
------


```js
forget()
```

### Parameters

None.

### Return value

A `Promise` which resolves with `undefined` once the device access permission is revoked.

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

| Specification |
| --- |
| WebUSB API # dom-usbdevice-forget |

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

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

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

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

* Learn more
* See full compatibility
* Report feedback
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The **`controlTransferIn()`** method of the `USBDevice` interface returns a `Promise` that resolves with a `USBInTransferResult` when a command or status request has been transmitted to (received by) the USB device.

Syntax
------


```js
controlTransferIn(setup, length)
```

### Parameters

`setup`

An object that sets options for. The available options are:

`requestType`

Must be one of three values specifying whether the transfer is `"standard"` (common to all USB devices) `"class"` (common to an industry-standard class of devices) or `"vendor"`.

`recipient`

Specifies the target of the transfer on the device, one of `"device"`, `"interface"`, `"endpoint"`, or `"other"`.

`request`

A vendor-specific command.

`value`

Vendor-specific request parameters.

`index`

The interface number of the recipient.


`length`

The maximum number of bytes to read from the device. The actual data is in the `USBInTransferResult` in the resolved Promise.

### Return value

`promise` that resolves with a `USBInTransferResult`.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-controltransferin |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: vendorId 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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`vendorId`** read only property of the
 `USBDevice` interface is the official usb.org-assigned vendor ID.

Value
-----

The official usb.org-assigned vendor ID.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-vendorid |

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

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
USBDevice: deviceVersionSubminor 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
**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`deviceVersionSubminor`** read only property of the
 `USBDevice` interface the patch version number of the device in a semantic
 versioning scheme.

Value
-----

A number.

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

| Specification |
| --- |
| WebUSB API # ref-for-dom-usbdevice-deviceversionsubminor |

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

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