I want to use an USB HID from a website. The website will only be accessed by Chrome browsers. The solution should require a minimum amount of extra software and setup for the website user to work.
The USB device presents itself as USB HID to the OS and I need to write and read byte arrays to and from it in order to implement the manufacturers specification for some of the device's features.
My current solution consists of two parts:
- A Chrome App that uses the
chrome.hid
API to talk to the device. This App exposes a Chrome Cross-Extension messaging port to provide and interface for "service calls". - JavaScript code on the website that sends requests to the Chrome App, which then talks to the USB device to process the request.
In order to make it easier for the user I want to get rid of the App, so the user can just surf to the website, grant access to the device if necessary and then be able to use the device. To be clear, I want the user to be able to use the website without installing any dependency first.
I already tried using the WebUSB navigator.usb
API but Chrome blocks access to USB HID devices. Is there another way to accomplish this?