v154 · webhid on android

The interface, and what it can tell you

Two objects and about fifteen members between them. Read out from this browser, with a note beside each one about whether it needs a permission, a gesture, or nothing at all — because that distinction is most of what makes WebHID awkward to use.

navigator.hid

What each member needs before it will do anything
memberpresent?needswhat it does

HIDDevice

Note the pairing: sendReport and oninputreport for the ordinary stream, sendFeatureReport and receiveFeatureReport for configuration, and forget for giving the permission back. That last one is the part most APIs are missing — a page can revoke its own access without asking the user to go and find a settings page.

Devices this origin may already use

Devices returned by getDevices()
productvendorproduct idcollectionsopen?
Not read yet.

getDevices() is the only call here that needs no gesture, and it returns only what the user has already permitted for this origin — so an empty list is the normal answer and says nothing about what is plugged in.

see also