这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
configuration
read only property of the
USBDevice
interface returns a
USBConfiguration
object for the currently selected interface for a paired USB device.
var USBConfiguration = USBDevice.configuration
A
USBConfiguration
对象。
The following example uses this property to test for the existence of a USBConfiguration property to select a configuration before claiming an interface.
async function connectDevice(usbDevice) {
await usbDevice.open();
if (usbDevice.configuration === null)
await usbDevice.selectConfiguration(1);
await usbDevice.claimInterface(0);
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebUSB
The definition of 'configuration' in that specification. |
草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
configuration
|
Chrome 61 | Edge 79 | Firefox No | IE No | Opera 48 | Safari No | WebView Android No | Chrome Android 61 | Firefox Android No | Opera Android 45 | Safari iOS No | Samsung Internet Android 8.0 |
完整支持
不支持
实验。期望将来行为有所改变。