Web/API/USBInterface

From Get docs

Draft This page is not complete.


Secure contextThis feature is available only in secure contexts (HTTPS), in some or all supporting browsers.


The USBInterface interface of the WebUSB API provides information about an interface provided by the USB device. An interface represents a feature of the device which implements a particular protocol and may contain endpoints for bidirectional communication.

Constructor

USBInterface.USBInterface
Creates a new USBInterface object which will be populated with information about the interface on the provided USBConfiguration with the given interface number.

Properties

USBInterface.interfaceNumberRead only
Returns the interface number of this interface. This is equal to the bInterfaceNumber field of the interface descriptor defining this interface.
USBInterface.alternateRead only
Returns the currently selected alternative configuration of this interface. By default this is the USBAlternateInterface from alternates with alternateSetting equal to 0. It can be changed by calling USBDevice.selectAlternateInterface() with any other value found in alternates.
USBInterface.alternatesRead only
Returns an array containing instances of the USBAlternateInterface interface describing each of the alternative configurations possible for this interface.
USBInterface.claimedRead only
Returns whether or not this interface has been claimed by the current page by calling USBDevice.claimInterface().

Specifications

Specification Status Comment
WebUSBThe definition of 'USBInterface' in that specification. Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

USBInterface

Experimental'

Chrome

Full support 61

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

Full support 48

Safari

No support No

WebView Android

No support No

Chrome Android

Full support 61

Firefox Android

No support No

Opera Android

Full support 45

Safari iOS

No support No

Samsung Internet Android

Full support 8.0

USBInterface() constructor

Experimental'

Chrome

Full support 61

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

Full support 48

Safari

No support No

WebView Android

No support No

Chrome Android

Full support 61

Firefox Android

No support No

Opera Android

Full support 45

Safari iOS

No support No

Samsung Internet Android

Full support 8.0

alternate

Experimental'

Chrome

Full support 61

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

Full support 48

Safari

No support No

WebView Android

No support No

Chrome Android

Full support 61

Firefox Android

No support No

Opera Android

Full support 45

Safari iOS

No support No

Samsung Internet Android

Full support 8.0

alternates

Experimental'

Chrome

Full support 61

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

Full support 48

Safari

No support No

WebView Android

No support No

Chrome Android

Full support 61

Firefox Android

No support No

Opera Android

Full support 45

Safari iOS

No support No

Samsung Internet Android

Full support 8.0

claimed

Experimental'

Chrome

Full support 61

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

Full support 48

Safari

No support No

WebView Android

No support No

Chrome Android

Full support 61

Firefox Android

No support No

Opera Android

Full support 45

Safari iOS

No support No

Samsung Internet Android

Full support 8.0

interfaceNumber

Experimental'

Chrome

Full support 61

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

Full support 48

Safari

No support No

WebView Android

No support No

Chrome Android

Full support 61

Firefox Android

No support No

Opera Android

Full support 45

Safari iOS

No support No

Samsung Internet Android

Full support 8.0

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.