| Crates.io | not-webusb |
| lib.rs | not-webusb |
| version | 0.1.2 |
| created_at | 2025-07-20 11:34:04.569329+00 |
| updated_at | 2025-07-28 12:02:05.068423+00 |
| description | Communicate between a webpage and a usb device without webusb |
| homepage | |
| repository | https://github.com/rukai/not-webusb-rs |
| max_upload_size | |
| id | 1761002 |
| size | 161,136 |
An alternative to webUSB for simple usecases with better browser support and the ability to restrict which sites can access the device.
Usage follows a request/response model where the browser JS or wasm sends a request to which the device must send exactly 1 response.
The goal is to be a production ready library for use in real devices. However, while it works fine for simple use cases, it needs more scrutiny and testing before I would be comfortable using it in production.
not-webusb consists of:
Unlike webusb which supports only chrome and edge. not-webusb supports all major browsers, having been tested on:
Far slower than webusb since it has to go through a lot of overhead with the U2F protocol. For example, to round trip 5kB of data it takes the following on different browsers:
Also, most browsers flash the entire window with an alert every time a not-webusb transfer occurs.

However, on firefox, only a small non-fullscreen box appears instead.
not-webusb is built on top of U2F (the legacy part of FIDO) the protocol for security keys.
However instead of implementing a security key, not-webusb smuggles data through the application_parameter and signature fields of the Authenticate messages sent between the browser and the device.
This is a fundamental part of the protocol and cannot be removed by browsers without rendering large numbers of currently working security keys unusable.
The idea comes from the I Cant Believe Its Not WebUSB demo, which uses the same fields to control an LED from the browser.
With a debugger+pico connected, and probe-rs installed, the examples can be run by one of:
./serve.sh and then navigating to localhost:8000and then following the instructions on the page.
defmt - enable defmt loggingInstall system deps:
# TODO: confirm which are really needed
sudo apt install ninja-build mercurial python-is-python3 g++-14 libudev-dev
Flash the rot13 example firmware to a pico and then run cargo test.