Websites take control of USB devices: Googlers propose WebUSB API

What could possibly go wrong? Wait, what could possibly go right

Two Google engineers have drafted a software interface that allows websites to control USB devices.

Reilly Grant and Ken Rockot say their proposed WebUSB API allows hardware developers to configure and control USB devices from webpages, simplifying the process of installing and setting up equipment.

"Today when you connect a device to your computer, you hope that somehow it will find the right driver and it will Just Work. For lots of devices it does, because there are standardized drivers for things like keyboards, mice, hard drives and webcams built into the operating system," the developers said.

"What about the long tail of unusual devices or the next generation of gadgets that haven't been standardized yet?"

WebUSB attempts to solve that problem by letting the device connect to a web server rather than rely on installed software. In addition to controlling the hardware, a website could install firmware updates and perform other basic tasks.

The Googlers note that WebUSB is not intended to be a one-size-fits-all solution for linking up any USB device with any controller. The API contains origin protections that will restrict the domains a single device can access and where it can receive updates and downloads, a process the developers liken to the CORS (cross origin resource sharing) protections on HTTP data transfers.

One use-case the developers suggest is 3D printers. Rather than having to install software drivers to configure the printer and calibrate the hardware, a developer could simply create a web application that handles the entire process automatically.

"WebUSB thus replaces native code and native SDKs with cross-platform hardware support and web-ready libraries," the developers said.

Currently, WebUSB remains very much a work in progress. The API – spotted over the weekend – is still considered unofficial and is hosted through the W3C's Web Platform Incubator Community Group (WICG). Grant and Rockot say that any member of the WICG is welcome to contribute to the project. ®

Biting the hand that feeds IT © 1998–2021