v131 · device

WebHID on Dedicated Workers

WebHID is enabled inside dedicated worker contexts. This allows developers to perform heavy I/O and processing of data from a HID device on a separate thread to reduce the performance impact on the main thread.

concepts

  1. WebHID in Workers

    WebHID is available inside Dedicated Workers. Off-main-thread HID processing for input-heavy peripherals (musical controllers, drawing tablets).

  2. Latency under load

    Main-thread polling jitters under UI jank; the worker variant stays flat. Drag the synthetic-jank slider.

  3. Worker probe + enumerate

    Spawn a worker, probe whether navigator.hid is exposed inside it, then enumerate devices from the worker context.

  4. Two devices, two workers

    Simulate a 120Hz joystick + 60Hz gamepad on separate workers. Main-thread frame time stays flat.

why it shipped

By combining the capabilities of WebHID and dedicated workers, web developers can minimize input latency and ensure a smooth user experience, even with the complexities of specialized gaming hardware.

references