Live data from Hacker News

WebUSB Extension for Firefox

github.com

171–180 of 264 posts

Re: WebUSB Extension for Firefox

#171
WebUSB has been used by projects like GrapheneOS, ESPHome, and Meshtastic. Google has used WebUSB to let users convert Stadia controllers to regular bluetooth input devices. Some manufacturers of keyboards use WebUSB for their configuration utilities.

It's an incredibly useful API, and it's secure. You have to explicitly pick a device to give access to. Mozilla's attitude in refusing to natively implement it seems neither reasonable nor rational. Though that is unfortunately on-par with what I've come to expect from them over the past ten or so years.

Re: WebUSB Extension for Firefox

#172
post #166

Earlier quoted context omitted.

The most important USB thing I have are storage devices. Keyboards/mice/etc are much less of a concern. If something rogue happens to a drive, that's a "major problem in Australia. Please help us stop it" situation.

That would indeed be horrible, which is why storage devices are explicitly excluded from WebUSB.

It's a good thing that history has shown us that things have never happened that were designed not to happen. Sure, my tinfoil hat is securely fashioned, but I've been around long enough to see things get subverted even if it's not until long after release.

Re: WebUSB Extension for Firefox

#173
post #102

I was rather hostile towards WebUSB/Bluetooth for ideological reasons, until I came across some cool apps like a climbing board control app (Bluetooth) or a netMD (to transfer to minidisks, via USB), which I would have found overkill to install a "hard App" for. I'm glad that there's an option for Firefox at last.

There is a host of software that only runs on Windows which can now run on any os with webusb. It's a glorious improvement

Re: WebUSB Extension for Firefox

#174
post #160

Earlier quoted context omitted.

> Permission popups fatigue Native apps also have this, and it's worse because they usually just ask for sweeping admin access on windows, unlike WebUSB which just brings up a device selection menu

> Native apps also have this, and it's worse because they usually just ask for sweeping admin access on windows On iOS they only pop up the menu when they try to access the required functionality, and there's a limited number of things they can do. > unlike WebUSB which just brings up a device selection menu So the user has to contend with permissions on phones, in desktop OSes, but 26 more potential permissions [1]…

> On iOS they only pop up the menu when they try to access the required functionality, and there's a limited number of things they can do.

great! your web browser does the exact same thing!

> 26 more potential permissions [1] from a browser are fine because a) it's just a single permission window and b) the browser exists in total vacuum from all other user experiences.

your argument is a non-sequitur; if I go install a firmware flasher, it is going to ask for permission to access the device I am flashing no matter what. on macos it will ask for "full disk access" for all your disks! on windows it will ask me "Do you want to allow this app to make changes to your device?" (what changes????). and then after that the app has to look at all of your devices and ask you which you want to use, and if there's a bug in the code, it might operate on the wrong one.

those OS permissions are confusing and obtuse, dare I say useless, and yet they still exist, and of course they cause fatigue!

whereas if you go to a webusb tool, the browser presents you a list of devices, with only the ones the app can use visible, and the app never gets more permission than it needs. it is simply a better UX and DX than the "permissions" cloud you're yelling at.

Re: WebUSB Extension for Firefox

#175
post #102

I was rather hostile towards WebUSB/Bluetooth for ideological reasons, until I came across some cool apps like a climbing board control app (Bluetooth) or a netMD (to transfer to minidisks, via USB), which I would have found overkill to install a "hard App" for. I'm glad that there's an option for Firefox at last.

Same here, was skeptical at first but then I used a web app that supports WebUSB to configure my mechanical keyboard and it lets you flash the firmware right there from the browser and that’s pretty nice and convenient. https://www.zsa.io/flash Even before WebUSB, I was using ZSA Oryx to create my keyboard layout for my first ZSA keyboard. But back then I had to download the file and then flash it using a dedicated p…

is anyone making backups of these webapps? my keyboard uses one for everything, I've been meaning to learn how to host a local copy for when the website inevitably gets shut down

Re: WebUSB Extension for Firefox

#176
post #102

I was rather hostile towards WebUSB/Bluetooth for ideological reasons, until I came across some cool apps like a climbing board control app (Bluetooth) or a netMD (to transfer to minidisks, via USB), which I would have found overkill to install a "hard App" for. I'm glad that there's an option for Firefox at last.

It's fine as an extension, not so much as a default-enabled feature. We got the best outcome here. Edit: Wait, no we didn't. Chrome added WebUSB support after all. Wtf I'm disabling that

Chrome has had WebUSB since 2017. I really appreciate it for one-off configurators and those types of tools.

Re: WebUSB Extension for Firefox

#178

WebUSB has been used by projects like GrapheneOS, ESPHome, and Meshtastic. Google has used WebUSB to let users convert Stadia controllers to regular bluetooth input devices. Some manufacturers of keyboards use WebUSB for their configuration utilities. It's an incredibly useful API, and it's secure. You have to explicitly pick a device to give access to. Mozilla's attitude in refusing to natively implement it seems ne…

Honestly, an extension seems like the perfect solution for this. Wanting a website to access your USB stack directly (or Bluetooth, which has a similar standard) is such an extremely niche use case that it’s probably better for it to be available only as an opt-in extension. They can still standardize it, but… let me just not have it by default please.

On iOS, there’s a “Bluetooth browser” app which is basically a simple WebView-based browser, but with the Bluetooth JS spec implemented so that you can use it to configure whatever Bluetooth device you have that wants to use a webapp for configuration. And you know what? That’s fine. It’s perfect, actually. A separate app I can use for the 0.0001% of the time I actually need to interact with some random IoT device’s Bluetooth configuration UI, and my normal web browser doesn’t need the bloat and increased attack surface. It just seems like good engineering to me to do it this way.

More of the enormous bloated JS web API specs should be implemented as browser plugins. Let’s make the default footprint even smaller.

Re: WebUSB Extension for Firefox

#179
post #83

Earlier quoted context omitted.

Native android apps can talk to regular USB devices, if granted the necessary permissions. But it's exposed through a Java api (and Kotlin I suppose, these days), which is fine, but it means you need to write your client logic twice. If you target the web, you can do it once. (Yes, you could try to bulid some common interface, libusb-style, but I think you'll have a bad time with minor behavioural differences, especi…

So you can't just use fastboot in termux, with https://github.com/nohajc/termux-adb , then?

It uses libusb, so yes, modulo aforementioned documented caveats (as well as the undocumented ones)

Re: WebUSB Extension for Firefox

#180

Earlier quoted context omitted.

> not so much as a default-enabled feature. The browser opens a popup asking you if you want to grant access to a specific device for a specific website, it's not like random websites can just run adb commands on your phone

Yeah but still, I'd want that to only remotely be a thing. Like require enabling a developer setting for it.

That's a great way to kill adoption of a feature. But what has WebUSB done to you?
Post reply on HN