Can chromium snap declare raw-usb plug

A potential project may need to use raw-usb plug (for webusb).

This interface does not auto connect: https://docs.snapcraft.io/the-raw-usb-interface/7908

The project could connect it via their gadget.

Can the raw-usb plug be added so that the chromium snap does not need to be forked just for this interface?

Cheers

i guess you want @oSoMoN’s attention here :slight_smile:

That’s a sensible request. @kyleN, can you confirm whether adding this interface is all that’s needed to make webusb work in chromium, per instructions in this other thread ?

1 Like

I will test this, thanks.

AIUI webusb needs an extension on the chromium side … do we expect this to be pre-installed in some form ?

It is built into chromium and has to be enabled by a launch flag AIUI. Where is the info about needing an extension?

oops, sorry, i mixed that up, it was an extension in chrome (for the retired chrome apps) but is builtin into chromium

(it seems to be pretty controversial due to security implications though (you can fish yubikey devices and such to overcome SSO when it is enabled))

1 Like

yes, that is a known issue the project is comfortable with. indeed required.

@oSoMoN. I have partial confirmation that raw-usb works for webusb as intented (on core 16: I want 18, but I have no straightforward path to testing this on 18 yet). I modified @ogra’s dashboard-client-browser snap (on edge/armhf) to add the raw-usb plug (and to show cursor), and I set the browser to point here: https://knitzsche.github.io/test1/ a web page I wrote that uses some of the webusb api available in chromium. When raw-usb is connected and I plug in a usb device, the JS causes the built in webusb popup to display, and my usb device is on the list. When raw-usb is disconnected, the device does not appear on the list. (I cannot yet test actual use of a usb device since I lack a USB device that includes support for webusb at this time. )

1 Like

Sorry for the delayed response @kyleN.
I have received third-party confirmation that the raw-usb plug enables WebUSB to work in chromium (see bug #1780678), so I am adding it now in all channels.

What are the specific denials that prevent this from working? Reading https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web, it’s unclear to me that raw-usb is the right choice or if a new interface should be added or an existing one modified.

@kyleN if you have a test setup to exercise WebUSB, can you please confirm that connecting the raw-usb interface in the latest chromium snap makes it work? And then, can you disconnect it and share the full log of denials, to answer Jamie’s question? Thanks!

I’m going to remove this from our queue for now. When the requested information is provided, we can add it back.

Apologies for the delayed response. Project that this was potentially for is no longer active. Cheers