この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!
この記事を English (US) で読むこともできます。

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The USB interface of the WebUSB API provides attributes and methods for finding and connecting USB devices from a web page.

Properties

None.

Event handlers

USB.onconnect
An event handler called whenever a previously paired device is connected.
USB.ondisconnect
An event handler called whenever a paired device is disconnected.

Methods

USB.getDevices()
Returns a Promise that resolves with an array of USBDevice objects for paired attached devices.
USB.requestDevice()
Returns a Promise that resolves with an instance of USBDevice if the specified device is found. Calling this function triggers the user agent's pairing flow.

Specifications

Specification Status Comment
WebUSB
The definition of 'USB' in that specification.
Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
USB
Experimental
Chrome Full support 61Edge No support NoFirefox No support NoIE No support NoOpera Full support 48Safari No support NoWebView Android No support NoChrome Android Full support 61Firefox Android No support NoOpera Android Full support 45Safari iOS No support NoSamsung Internet Android No support No
getDevices
Experimental
Chrome Full support 61Edge No support NoFirefox No support NoIE No support NoOpera Full support 48Safari No support NoWebView Android No support NoChrome Android Full support 61Firefox Android No support NoOpera Android Full support 45Safari iOS No support NoSamsung Internet Android No support No
onconnect
Experimental
Chrome Full support 61Edge No support NoFirefox No support NoIE No support NoOpera Full support 48Safari No support NoWebView Android No support NoChrome Android Full support 61Firefox Android No support NoOpera Android Full support 45Safari iOS No support NoSamsung Internet Android No support No
ondisconnect
Experimental
Chrome Full support 61Edge No support NoFirefox No support NoIE No support NoOpera Full support 48Safari No support NoWebView Android No support NoChrome Android Full support 61Firefox Android No support NoOpera Android Full support 45Safari iOS No support NoSamsung Internet Android No support No
requestDevice
Experimental
Chrome Full support 61Edge No support NoFirefox No support NoIE No support NoOpera Full support 48Safari No support NoWebView Android No support NoChrome Android Full support 61Firefox Android No support NoOpera Android Full support 45Safari iOS No support NoSamsung Internet Android No support No

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.

ドキュメントのタグと貢献者

このページの貢献者: mdnwebdocs-bot, aboagyed, jpmedley
最終更新者: mdnwebdocs-bot,