Skip to Content
Platform.Ontology

WebHID

Lets a site read and write raw reports from a keyboard, pad or other HID device the person picks.

Asks you firstHardware and accessoriesHIDWeb browsersWhile you use it

In one line

Can talk to one keyboard, pad or other device you pick from a list

Lets a site read and write raw reports from a keyboard, pad or other HID device the person picks.

Gives full access to exotic input hardware (Stream Decks, game controllers, 3D mice, medical devices) beyond what the OS exposes. The device list and report data can identify the hardware and its state.

What it can and can't do

What the user does: You tap Connect device and pick one from the chooser.

It can

  • Show devices that match what the site asks for
  • Get the buttons, keys and sensor data of the one you pick
  • Send commands such as lights or settings to it

It cannot

  • Use devices you did not pick
  • Work with your normal keyboard and mouse, which browsers keep blocked
  • Work in Firefox, Safari or on phones
  • Keep access after you remove the permission

How it differs between platforms: Only desktop Chrome and Edge support it. Firefox, Safari and phone browsers do not.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported892021-03-02None
EdgeSupported892021-03-04None
FirefoxNot supportedNot availableNot listedNone
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidNot supportedNot availableNot listedNo WebHID on Android
Samsung InternetNot supportedNot availableNot listedNo WebHID on Android

How a site asks for it

APInavigator.hid.requestDevice({filters}), getDevices(), device.open(), sendReport(), oninputreport
Permission namehid
Permissions policyhid
Browser compat keysapi.HID
api.HIDDevice
api.Navigator.hid
How access is grantedpicker
What the user seesChooser listing HID devices that match filters
Needs a secure context (HTTPS)Yes
Needs a user gestureYes
How long it lastsPer origin and device; getDevices() returns granted devices
How to take it backSite settings, chooser, device.forget() (Chrome 100+)
Inside an iframeNeeds allow="hid"; workers supported from Chrome 131

Typical flow

  1. Click
  2. requestDevice() with usagePage/usage filters
  3. open()
  4. Listen for inputreport events and call sendReport() or sendFeatureReport()

Data you get

What comes back: Raw HID input, output and feature reports
Shape: stream
How often: event per report; device rate (125 to 1000 Hz typical)

FieldTypeUnitRangePrecision
vendorIdintegerNone0 to 65535Not listed
productIdintegerNone0 to 65535Not listed
productNamestringNonedevice definedNot listed
collections[].usagePage / usageintegerNoneHID usage tablesNot listed
reportIdintegerNone0 to 255Not listed
databinarybytesreport size per descriptor (often 8 to 64)Not listed

Technical limits

  • Chrome blocks FIDO security keys, and usages for keyboards and mice are blocklisted so a site cannot capture keystrokes
  • Not available on Android Chrome, Firefox, Safari
  • Needs HTTPS
  • Blocklist maintained in Chromium hid_blocklist

The story

What it is

A site can read and write raw data from a keyboard, pad or other device you pick.

For you

A picker shows devices like a controller or macro pad. You choose one, and the page can use all its special buttons and lights.

For makers

Makers can support odd or high end devices that the standard gamepad tool misses. It is how a web page can set up a keyboard or a PlayStation controller.

Where you see it

TypeExampleApps
gamesA web page reads every button on a PlayStation controller and updates its firmware.None named
creativeA web page lets you remap keys on a custom keyboard.VIA, QMK
enterpriseA web point of sale reads a barcode or card reader.None named
accessibilityA web app uses a special switch device for people with limited movement.None named
liveA stream deck style pad controls scenes from a web page.Elgato
securityA bad page could ask for a keyboard device and read what you type on it, so the picker matters.None named

Risks

  • Keystroke exposure
  • Not on Safari

What the platform says

  • Google: WebHID. Chrome's docs say WebHID lets pages talk to special keyboards, gamepads and other human interface devices.

Good uses and abuse

Legitimate uses

  • Game controller remapping
  • LED and macro keyboards (VIA, QMK)
  • Lab and medical hardware

Known abuse

  • Hardware fingerprinting after one grant
  • Social engineering around a fake device setup

Scores

ScoreValueMeaning
Sensitivity4 of 5How revealing the data is
Utility3 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

  • 2021-03, Chrome 89: WebHID ships on desktop Chrome and Edge
  • 2022-01, Chrome 100: device.forget()
  • 2024-11, Chrome 131: WebHID in dedicated and shared workers
  • WebUSB. Can talk to one USB device you pick from a list
  • Gamepad API and haptics. Can see your game controller after you press a button, and make it rumble

Sources

How well checked: Checked against real behavior.

On this page