access mass storage device on web browser with WEBUSB API

1k views Asked by At

how to display all mass storage device (e.g.-pen drive, etc..) data in a web browser. I have successfully accessed comport device in the browser using serial API, but how to access the mass storage device in the browser?

1

There are 1 answers

1
François Beaufort On

Web USB doesn't allow you to access Mass Storage devices for privacy and security reasons.

Note: This specification attempts to strike a balance between protecting users from malicious content by limiting access to sensitive devices while enabling support for as many devices as possible. As stated in the introduction the goal of this API is to support devices which are not covered by other, more high level APIs. The list above includes interface classes for which such high level APIs exist and provide greater protection for user privacy and security than low level access through this API would.

You can see that it's blocked by going to the internal about://usb-internals/ page in Chromium-based browsers such as Chrome and look for "Blocked by WebUSB".

The current list of protected classes is available at https://wicg.github.io/webusb/#has-a-protected-interface-class:

Protected interface classes
Code    Description
0x01    Audio
0x03    HID (Human Interface Device)
0x08    Mass Storage
0x0B    Smart Card
0x0E    Video
0x10    Audio/Video Devices
0xE0    Wireless Controller