This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The USBDevice
interface of the the WebUSB API provides access to metadata about a paired USB device and methods for controlling it.
USBDevice.configuration
Read only
USBConfiguration
object for the currently selected interface for a paired USB device.USBDevice.configurations
Read only
array
of device-specific interfaces for controlling a paired USB device.USBDevice.deviceClass
Read only
USBDevice.deviceSubclass
and USBDevice.deviceprotocol
.USBDevice.deviceProtocol
Read only
USBDevice.deviceClass
and USBDevice.deviceSubclass
.USBDevice.deviceSubclass
Read only
USBDevice.deviceClass
and USBDevice.deviceProtocol
.USBDevice.deviceVersionMajor
Read only
USBDevice.deviceVersionMinor
Read only
USBDevice.deviceVersionSubminor
Read only
USBDevice.manufacturerName
Read only
USBDevice.opened
Read only
USBDevice.productId
Read only
USBDevice.productName
Read only
USBDevice.serialNumber
Read only
USBDevice.usbVersionMajor
Read only
USBDevice.usbVersionMinor
and USBDevice.usbVersionSubminor
.USBDevice.usbVersionMinor
Read only
USBDevice.usbVersionMajor
and USBDevice.usbVersionSubminor
.USBDevice.usbVersionSubminor
Read only
USBDevice.usbVersionMajor
and USBDevice.usbVersionMinor
.USBDevice.vendorId
Read only
USBDevice.claimInterface()
promise
that resolves when the requested interface is claimed for exclusive access.USBDevice.clearHalt()
promise
that resolves when a halt condition is cleared.USBDevice.controlTransferIn()
promise
that resolves with a USBTransferInResult
when a command or status operation has been transmitted to the USB device.USBDevice.controlTransferOut()
promise
that resolves with a USBTransferOutResult
when a command or status operation has been transmitted from the USB device.USBDevice.close()
promise
that resolves when all open interfaces are released and the device session has ended.USBDevice.isochronousTransferIn()
promise
that resolves with a USBIsochronousInTransferResult
when time sensitive information has been transmitted to the USB device.USBDevice.isochronousTransferOut()
promise
that resolves with a USBIsochronousOutTransferResult
when time sensitive information has been transmitted from the USB device.USBDevice.open()
promise
that resolves when a device session has started.USBDevice.releaseInterface()
promise
that resolves when a cliamed interface is released from exclusive access.USBDevice.reset()
promise
that resolves when the device is reset and all app operations canceled and their promises rejected.USBDevice.selectAlternateInterface()
promise
that resolves when the specified alternative endpoint is selected.USBDevice.selectConfiguration()
promise
that resolves when the specified configuration is selected.USBDevice.transferIn()
promise
that resolves with a USBTransferInResult
when bulk or interrupt data is transmitted to the USB device.USBDevice.transferOut()
promise
that resolves with a USBTransferOutResult
when bulk or interrupt data is transmitted from the USB device.Specification | Status | Comment |
---|---|---|
WebUSB The definition of 'USBDevice' in that specification. | Draft | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 61 | No | No | No | 48 | No |
usbVersionMajor
|
61 | No | No | No | 48 | No |
usbVersionMinor
|
61 | No | No | No | 48 | No |
usbVersionSubminor
|
61 | No | No | No | 48 | No |
deviceClass
|
61 | No | No | No | 48 | No |
deviceSubclass
|
61 | No | No | No | 48 | No |
deviceProtocol
|
61 | No | No | No | 48 | No |
vendorId
|
61 | No | No | No | 48 | No |
productId
|
61 | No | No | No | 48 | No |
deviceVersionMajor
|
61 | No | No | No | 48 | No |
deviceVersionMinor
|
61 | No | No | No | 48 | No |
deviceVersionSubminor
|
61 | No | No | No | 48 | No |
manufacturerName
|
61 | No | No | No | 48 | No |
productName
|
61 | No | No | No | 48 | No |
serialNumber
|
61 | No | No | No | 48 | No |
configuration
|
61 | No | No | No | 48 | No |
configurations
|
61 | No | No | No | 48 | No |
opened
|
61 | No | No | No | 48 | No |
open
|
61 | No | No | No | 48 | No |
close
|
61 | No | No | No | 48 | No |
selectConfiguration
|
61 | No | No | No | 48 | No |
claimInterface
|
61 | No | No | No | 48 | No |
releaseInterface
|
61 | No | No | No | 48 | No |
selectAlternateInterface
|
61 | No | No | No | 48 | No |
controlTransferIn
|
61 | No | No | No | 48 | No |
controlTransferOut
|
61 | No | No | No | 48 | No |
clearHalt
|
61 | No | No | No | 48 | No |
transferIn
|
61 | No | No | No | 48 | No |
transferOut
|
61 | No | No | No | 48 | No |
isochronousTransferIn
|
61 | No | No | No | 48 | No |
isochronousTransferOut
|
61 | No | No | No | 48 | No |
reset
|
61 | No | No | No | 48 | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | No | 61 | No | No | 48 | No | No |
usbVersionMajor
|
No | 61 | No | No | 48 | No | No |
usbVersionMinor
|
No | 61 | No | No | 48 | No | No |
usbVersionSubminor
|
No | 61 | No | No | 48 | No | No |
deviceClass
|
No | 61 | No | No | 48 | No | No |
deviceSubclass
|
No | 61 | No | No | 48 | No | No |
deviceProtocol
|
No | 61 | No | No | 48 | No | No |
vendorId
|
No | 61 | No | No | 48 | No | No |
productId
|
No | 61 | No | No | 48 | No | No |
deviceVersionMajor
|
No | 61 | No | No | 48 | No | No |
deviceVersionMinor
|
No | 61 | No | No | 48 | No | No |
deviceVersionSubminor
|
No | 61 | No | No | 48 | No | No |
manufacturerName
|
No | 61 | No | No | 48 | No | No |
productName
|
No | 61 | No | No | 48 | No | No |
serialNumber
|
No | 61 | No | No | 48 | No | No |
configuration
|
No | 61 | No | No | 48 | No | No |
configurations
|
No | 61 | No | No | 48 | No | No |
opened
|
No | 61 | No | No | 48 | No | No |
open
|
No | 61 | No | No | 48 | No | No |
close
|
No | 61 | No | No | 48 | No | No |
selectConfiguration
|
No | 61 | No | No | 48 | No | No |
claimInterface
|
No | 61 | No | No | 48 | No | No |
releaseInterface
|
No | 61 | No | No | 48 | No | No |
selectAlternateInterface
|
No | 61 | No | No | 48 | No | No |
controlTransferIn
|
No | 61 | No | No | 48 | No | No |
controlTransferOut
|
No | 61 | No | No | 48 | No | No |
clearHalt
|
No | 61 | No | No | 48 | No | No |
transferIn
|
No | 61 | No | No | 48 | No | No |
transferOut
|
No | 61 | No | No | 48 | No | No |
isochronousTransferIn
|
No | 61 | No | No | 48 | No | No |
isochronousTransferOut
|
No | 61 | No | No | 48 | No | No |
reset
|
No | 61 | No | No | 48 | No | No |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/USBDevice