WebUSB
Lets a site talk directly to a USB device the person picks.
In one line
Can talk to one USB device you pick from a list
Lets a site talk directly to a USB device the person picks.
Reveals which USB gadgets are plugged in (vendor, product, serial number) and lets the site control them. Used for dev boards, label printers and security keys; a path to device fingerprinting.
What it can and can't do
What the user does: You tap Connect device, pick one in the chooser and click Connect.
It can
- Show USB devices that match what the site asks for
- Connect to the one you pick
- Send and get data from it, such as a flash tool or a printer
It cannot
- Use USB devices you did not pick
- Use devices your computer already claims, like storage drives and keyboards
- Work in Firefox, Safari or on iPhone
- Keep access after you remove the permission or unplug it
How it differs between platforms: Chrome and Edge, including on Android, support it. Firefox and Safari, including iPhone, do not.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 61 | 2017-09-05 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 61 | 2017-09-05 | None |
| Samsung Internet | Supported | 8.0 | 2018-07-18 | None |
How a site asks for it
| API | navigator.usb.requestDevice({filters}), getDevices(), device.open(), transferIn/transferOut |
| Permission name | usb |
| Permissions policy | usb |
| Browser compat keys | api.USBapi.USBDeviceapi.Navigator.usb |
| How access is granted | picker |
| What the user sees | Browser chooser lists only devices matching filters; person selects one and clicks Connect |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | Per origin and per device until revoked; getDevices() returns previously granted devices without a prompt |
| How to take it back | Site settings, chooser 'forget' button, device.forget() (Chrome 101+), 'disconnect' event |
| Inside an iframe | Needs allow="usb" in cross-origin iframes; available in dedicated and service workers from Chrome 118 |
Typical flow
- User clicks a button
- requestDevice() shows chooser
- Page calls open(), selectConfiguration(), claimInterface()
- Page does bulk, interrupt, isochronous or control transfers
Data you get
What comes back: USB device descriptors plus raw data transfers
Shape: object
How often: on demand; connect and disconnect events
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
vendorId | integer | None | 0 to 65535 | 16 bit USB-IF id |
productId | integer | None | 0 to 65535 | 16 bit |
serialNumber | string | None | device defined | unique per unit when present |
productName / manufacturerName | string | None | device defined | Not listed |
usbVersionMajor/Minor/Subminor | integer | None | 0 to 255 | Not listed |
configurations[].interfaces[].alternates[] | list | None | per device | class, subclass, protocol, endpoints |
transfer payload | binary | bytes | up to 64 bytes per control transfer on low speed; bulk limited by endpoint packet size | Not listed |
Technical limits
- Cannot list devices without a user selection (filters required unless exclusionFilters/empty filters used with chooser)
- Cannot claim interfaces of protected classes: HID, mass storage, audio, video, printer, smart card, wireless controller
- Windows needs WinUSB driver or MS OS 2.0 descriptors; Linux needs udev rules
- No access without HTTPS
- Not in Firefox, Safari or iOS
The story
What it is
A site can talk straight to a USB gadget that you pick.
For you
A picker lists USB devices. You choose one and the page can set it up or talk to it, with no driver to install.
For makers
Makers can ship device setup and firmware updates as a web page. It cuts support cost since there is nothing to install.
Where you see it
| Type | Example | Apps |
|---|---|---|
| developer | A web page updates a keyboard or a microcontroller board over USB. | Arduino, QMK |
| creative | A web tool lets you adjust a drawing tablet's buttons. | None named |
| enterprise | A web based label printer app prints directly over USB. | Zebra, Brother |
| health | A web page reads data from a USB glucose meter. | None named |
| games | A web page flashes new firmware onto a game controller. | None named |
| security | A bad site could try to talk to a USB device that holds keys or data. | None named |
Risks
- Picking the wrong device
- Not on Safari
What the platform says
- Google: WebUSB. Chrome's docs say WebUSB lets pages safely use USB devices, with the user in control.
Good uses and abuse
Legitimate uses
- Firmware flashing (Arduino, ESP32, ZMK keyboards)
- Label and receipt printers
- Security key setup tools
Known abuse
- Fingerprinting by serial number once granted
- Malicious firmware flashing
- Phishing sites mimicking a hardware setup flow
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 4 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2016-07, Chrome 61: WebUSB ships (Chrome 61 stable Sep 2017, origin trial from 54)
- 2018-04, Chrome 67: Protected interface classes (HID, mass storage, audio, video, smart card) blocked from claim
- 2021-04, Chrome 89: Removed 'Serial number readable without permission' paths; granted devices persist
- 2023-10, Chrome 118: WebUSB exposed in workers
- 2024-01, Chrome 101: device.forget() added
Related capabilities
Related
- WebHID. Can talk to one keyboard, pad or other device you pick from a list
- Web Serial. Can open one serial port you pick and exchange data with it
Sources
How well checked: Checked against real behavior.