Questions tagged [webhid]

WebHID API provides access to devices that support the Human Interface Device (HID) protocol. Use this tag for questions about using the WebHID API on any browser.

WebHID API enables web applications to request access to HID devices, send and receive HID reports, and retrieve information about the report descriptor.

23 questions
2
votes
2 answers

Wait for WebHID response to be ready

I'm sending data to the target device using device.sendReport(reportID, dataBuffer) of WebHID, but trying to read the response before it gets ready (i.e) the response takes time to be generated. For now by setting timeout for 10ms, I'm able to get…
Hema
  • 31
  • 4
2
votes
1 answer

Can Chrome extensions communicate with USB-devices?

Chrome Apps can use the Chrome.usb and Chrome.hid apis. These are deprecated, when writing Chrome extensions. Is it possible to use web.usb or web.hid in the popup html? In my popup.js this if ("hid" in navigator) returns "True"
2
votes
2 answers

When should one use WebHID as opposed to WebUSB?

I have a proprietary USB device that has a flashing functionality over USB. I would like to replicate this flashing functionality from within the browser, but I am not certain what API to use. Visiting chrome://usb-internals/ to inspect my device…
2
votes
1 answer

WEBHID API: Inputreport not triggering with barcode scanner

Im pretty much using the Nintendo Switch Joy-Con controllers demo which I've modified a little to make it work with my barcode scanner. And it just wont work and if it does work it works once in 100 site refreshes. console.log = text => { …
Heimot
  • 49
  • 1
  • 7
2
votes
1 answer

How do I zero a USB scale using WebHID?

I am using WebHID in Chrome to communicate with a USB-enabled digital scale. I'm able to connect to the scale and subscribe to a stream of weight data as follows: // Get a reference to the scale. // 0x0922 is the vendor of my particular scale…
2
votes
1 answer

How can I connect an hid device to web app?

I want to connect an HID device to my web app, by USB connection. The WebUSB API does not suit to me, because the device is an HID device(when using the WebUSB API, after device.open() there are an error: 'Access Denied.'). I wanted to use the…
Chen k.
  • 21
  • 2
1
vote
1 answer

Webhid device opened, but oninputreport listener is not work

WebHID Example

WebHID Example

1
vote
2 answers

WebHID: no compatible device found, but device shows up in Chrome device log?

For starters I used navigator.hid.requestDevice without any filters. So I can see which devices are available before adding a custom filter, but my device doesn't show up in the HID browser device picker. However, in the chrome device log…
karamazovbros
  • 950
  • 1
  • 11
  • 40
1
vote
1 answer

navigator.enumerateDevices returning different Device IDs Intermittently

I am in the process of converting a chrome extension to manifest v3 and ran into an issue that may or may not be related to this. I am using the navigator.mediaDevices.enumerateDevices to get a list of the connected microphones. I am having issues…
Ryan H
  • 105
  • 8
1
vote
1 answer

Availability of WebHID/WebUSB APIs on iOS

I know WebHID/WebUSB are generally available in Google Chrome (https://caniuse.com/webhid and https://caniuse.com/?search=webusb) but are these APIs available also on the iOS version of Google Chrome? I was getting reports from users not being able…
Rafael Korbas
  • 2,213
  • 3
  • 19
  • 30
1
vote
1 answer

Is there a way to bypass WebHid USB limitation on Chrome browser?

Chrome 89 launched WebHid API with limitations for security. Limitations includes: Javascript cannot receive USB Hid data when browser tab switched. Javascript cannot receive USB Hid data when user is opening select html element ..... more in…
JasonHsieh
  • 553
  • 1
  • 6
  • 20
1
vote
1 answer

WebHID API: How do I parse data from inputReport event?

I'm trying to grab sensor input from my digitizer ( X Tilt, Y Tilt, Tip Pressure, Tip Switch, Eraser, Pen, Puck .etc) using the WebHID API. This is what I've gotten so far: index.js: page_log = text => { let p = document.createElement("p"); …
bobajeff
  • 131
  • 6
1
vote
2 answers

No Compatible Devices Found using WebHID on Chrome

I am trying to use the ACR122U NFC Reader with the WebHID API but I cannot seem to get it to be found by Chrome 91 Desktop on both Linux nor Windows. I know the browser is seeing the reader from chrome://usb-internals showing me this screen: The…
rxm
  • 71
  • 2
  • 11
1
vote
2 answers

WebHID API: reconnect device

Is it possible to "silently"(without calling navigator.hid.requestDevice) reconnect hid device after it was disconnected and connected with USB cable again? navigator.hid.getDevices is not an option, it doesn't return device after it was…
Igor Alemasow
  • 4,484
  • 2
  • 27
  • 24
0
votes
1 answer

webHID syntax for USB-Relay-2

I bought one of the really inexpensive USB relay boards from china with two relays. I am trying to switch the relays on and off from Chrome Javascript using webHID. Found this sample code https://blink1.thingm.com/ and modified it for this relay…
davewhirlwind
  • 209
  • 1
  • 12
1
2