0

I am writing a web-app, where my users use, a DS2490 ibutton reader, zebra scanner, zebra printer and Loadstar di1000 Loadcell. I run chrome os flex on the devices, that run this webapp, and i manage them via the google admin console. I am using the following policies: WebUsbAllowDevicesForUrls, UsbDetachableAllowlist, to give the web-app access to the usb devices

All devices, but the ibutton reader connect automatically, when the page is loaded.

I found this post, where the asker had kind of the same problem as me. It looks like the problem was that his custom usb device didn't have a serial number, and he solved it by giving it a one. When i look at the usb data of the ibutton reader, it shows that the serial number string is empty. Can the lack of a serial number have anything to do with the device not automatically connecting?

the post: How to re-connect to USB device without user gesture?

Connect function:

 async connect(e) {
 try {
 this.device = await navigator.usb.requestDevice(this.requestParams);
 }
 catch (e) {
 console.log(e);
 let devices = await navigator.usb.getDevices();
 devices.forEach((element) => {
 if (element.vendorId == this.deviceFilter.vendorId && element.productId == this.deviceFilter.productId) {
 this.device = element
 }
 });
 }
 if (this.device) {
 this.eventTarget.dispatchEvent(new Event('connect'));
 await this.device.open();
 await this.device.selectConfiguration(1);
 await this.device.claimInterface(0);
 this.connected = true
 this.eventTarget.dispatchEvent(new Event('open'));
 this.search = true
 this.searchLoop()
 } else {
 }
 }

1 Answer 1

0

That seems like a bug or user error. Make sure you have the vendor and product IDs set correctly for all the devices you want to get permission for by policy. The policy-based permission logic does not require the device to have a serial number.

If you are using Web Serial or WebHID for some of these devices note that they use different policies, SerialAllowUsbDevicesForUrls and WebHidAllowDevicesForUrls. Please reach out to your Enterprise support representative if you can't find these policies in the Admin Console.

Note: You probably don't need to set the UsbDetachableAllowlist policy unless one of those devices have a driver that automatically attaches when the device is connected.

answered Jun 27, 2023 at 20:39
Sign up to request clarification or add additional context in comments.

2 Comments

I have checked that the VID and PID is correctly set in the settings. I just tried to clear all website data and cookies on one of the kiosk machines. Now none of the devices connect. So i think you are right, that it is a user error. I think the permissions for the other devices were stored. Is there a special way you need to connect when you want to use permission by policy? I have added my connect function in the question
Rather than calling requestDevice() and then falling back to getDevices() on failure you will want to call getDevices() first to see what devices the site already has permission to access. The policy has no effect on the behavior of the requestDevice() method.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.