Skip to Content
Platform.Ontology

WebUSB

Lets a site talk directly to a USB device the person picks.

Asks you firstHardware and accessoriesUSBWeb browsersWhile you use itAfter you leave the site

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

BrowserStatusFirst versionReleasedNote
ChromeSupported612017-09-05None
EdgeSupported792020-01-15None
FirefoxNot supportedNot availableNot listedNone
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidSupported612017-09-05None
Samsung InternetSupported8.02018-07-18None

How a site asks for it

APInavigator.usb.requestDevice({filters}), getDevices(), device.open(), transferIn/transferOut
Permission nameusb
Permissions policyusb
Browser compat keysapi.USB
api.USBDevice
api.Navigator.usb
How access is grantedpicker
What the user seesBrowser chooser lists only devices matching filters; person selects one and clicks Connect
Needs a secure context (HTTPS)Yes
Needs a user gestureYes
How long it lastsPer origin and per device until revoked; getDevices() returns previously granted devices without a prompt
How to take it backSite settings, chooser 'forget' button, device.forget() (Chrome 101+), 'disconnect' event
Inside an iframeNeeds allow="usb" in cross-origin iframes; available in dedicated and service workers from Chrome 118

Typical flow

  1. User clicks a button
  2. requestDevice() shows chooser
  3. Page calls open(), selectConfiguration(), claimInterface()
  4. 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

FieldTypeUnitRangePrecision
vendorIdintegerNone0 to 6553516 bit USB-IF id
productIdintegerNone0 to 6553516 bit
serialNumberstringNonedevice definedunique per unit when present
productName / manufacturerNamestringNonedevice definedNot listed
usbVersionMajor/Minor/SubminorintegerNone0 to 255Not listed
configurations[].interfaces[].alternates[]listNoneper deviceclass, subclass, protocol, endpoints
transfer payloadbinarybytesup to 64 bytes per control transfer on low speed; bulk limited by endpoint packet sizeNot 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

TypeExampleApps
developerA web page updates a keyboard or a microcontroller board over USB.Arduino, QMK
creativeA web tool lets you adjust a drawing tablet's buttons.None named
enterpriseA web based label printer app prints directly over USB.Zebra, Brother
healthA web page reads data from a USB glucose meter.None named
gamesA web page flashes new firmware onto a game controller.None named
securityA 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

ScoreValueMeaning
Sensitivity4 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction2 of 5How much the user has to do
Fingerprint bitsNot ratedRough 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
  • 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.

On this page