USBDevice: configuration プロパティ
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。
USBDevice
インターフェイスの読み取り専用プロパティ configuration
は、ペアリングした USB デバイスの現在選択されているインターフェイスを表す USBConfiguration
オブジェクトを返します。
値
USBConfiguration
オブジェクトです。
例
以下の例では、インターフェイスを要求する前にコンフィギュレーションを選択するため、USBConfiguration
プロパティの存在を確認するためにこのプロパティを使用しています。
js
async function connectDevice(usbDevice) {
await usbDevice.open();
if (usbDevice.configuration === null) await usbDevice.selectConfiguration(1);
await usbDevice.claimInterface(0);
}
仕様書
Specification |
---|
WebUSB API # ref-for-dom-usbdevice-configuration① |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
configuration |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.