USBAlternateInterface

Limited availability

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

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.

Note: This feature is available in Web Workers.

The USBAlternateInterface interface of the WebUSB API provides information about a particular configuration of an interface provided by the USB device. An interface includes one or more alternate settings which can configure a set of endpoints based on the operating mode of the device.

Constructor

USBAlternateInterface()

Creates a new USBAlternateInterface object which will be populated with information about the alternate interface of the provided USBInterface with the given alternate setting number.

Instance properties

USBAlternateInterface.alternateSetting Read only

Returns the alternate setting number of this interface. This is equal to the bAlternateSetting field of the interface descriptor defining this interface.

USBAlternateInterface.interfaceClass Read only

Returns the class of this interface. This is equal to the bInterfaceClass field of the interface descriptor defining this interface. Standardized values for this field are defined by the USB Implementers Forum. A value of 0xFF indicates a vendor-defined interface.

USBAlternateInterface.interfaceSubclass Read only

Returns the subclass of this interface. This is equal to the bInterfaceSubClass field of the interface descriptor defining this interface. The meaning of this value depends on the interfaceClass field.

USBAlternateInterface.interfaceProtocol Read only

Returns the protocol supported by this interface. This is equal to the bInterfaceProtocol field of the interface descriptor defining this interface. The meaning of this value depends on the interfaceClass and interfaceSubclass fields.

USBAlternateInterface.interfaceName Read only

Returns the name of the interface, if one is provided by the device. This is the value of the string descriptor with the index specified by the iInterface field of the interface descriptor defining this interface.

USBAlternateInterface.endpoints Read only

Returns an array containing instances of the USBEndpoint interface describing each of the endpoints that are part of this interface.

Specifications

Specification
WebUSB API
# usbalternateinterface

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
USBAlternateInterface
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android
footnote
footnote WebView exposes this interface, but does not support WebUSB. See bug 41441927.
WebView on iOS – No support
WebView on iOS
footnote No support
USBAlternateInterface() constructor
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
alternateSetting
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
endpoints
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
interfaceClass
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
interfaceName
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
interfaceProtocol
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
interfaceSubclass
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
Available in workers
Experimental
Chrome – Partial support
Chrome 70 – 117 (Release date: 2018-10-16)
footnote Partial support
footnote Available in dedicated workers, not available in shared workers and service workers.
Chrome – Partial support
Chrome 118 (Release date: 2023-10-10)
footnote Partial support
footnote Available in dedicated workers and WebExtension service workers, not available in shared workers and normal service workers.
Edge – Partial support
Edge 79 – 117 (Release date: 2020-01-15)
footnote Partial support
footnote Available in dedicated workers, not available in shared workers and service workers.
Edge – Partial support
Edge 118 (Release date: 2023-10-13)
footnote Partial support
footnote Available in dedicated workers and WebExtension service workers, not available in shared workers and normal service workers.
Firefox – No support
Firefox
footnote No support
Opera – Partial support
Opera 57 – 103 (Release date: 2018-11-28)
footnote Partial support
footnote Available in dedicated workers, not available in shared workers and service workers.
Opera – Partial support
Opera 104 (Release date: 2023-10-23)
footnote Partial support
footnote Available in dedicated workers and WebExtension service workers, not available in shared workers and normal service workers.
Safari – No support
Safari
footnote No support
Chrome Android – Partial support
Chrome Android 70 – 117 (Release date: 2018-10-17)
footnote Partial support
footnote Available in dedicated workers, not available in shared workers and service workers.
Chrome Android – Partial support
Chrome Android 118 (Release date: 2023-10-10)
footnote Partial support
footnote Available in dedicated workers and WebExtension service workers, not available in shared workers and normal service workers.
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Partial support
Opera Android 49 – 78 (Release date: 2018-12-07)
footnote Partial support
footnote Available in dedicated workers, not available in shared workers and service workers.
Opera Android – Partial support
Opera Android 79 (Release date: 2023-12-06)
footnote Partial support
footnote Available in dedicated workers and WebExtension service workers, not available in shared workers and normal service workers.
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Partial support
Samsung Internet 10 – 24 (Release date: 2019-08-22)
footnote Partial support
footnote Available in dedicated workers, not available in shared workers and service workers.
Samsung Internet – Partial support
Samsung Internet 25 (Release date: 2024-04-24)
footnote Partial support
footnote Available in dedicated workers and WebExtension service workers, not available in shared workers and normal service workers.
WebView Android – No support
WebView Android
footnote
footnote WebView exposes this interface, but does not support WebUSB.
footnote See bug 41441927
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.
Has more compatibility info.