v0.0.2
Pre-releaseChanges in this Update
After reviewing the actual Chromium Blink implementation (third_party/blink/renderer/modules/webusb/usb_device.cc), I confirmed that transferIn, transferOut, and clearHalt completely lacked checks equivalent to EnsureEndpointAvailable() found in the production version of Chrome.
To address this, I extended the verification check ("whether the target interface is claimed"), which was previously added only to controlTransferIn/Out, to bulk/interrupt transfers and clearHalt.
This effectively plugs the loophole that allowed direct bulk/interrupt reading and writing to protected class endpoints without going through controlTransfer.
I have also added two regression tests and confirmed that they fail as expected when the fixes are reverted.
Isochronous Transfers (Implemented but Untested on Physical Devices)Although not available in the public pyusb API, I implemented this feature using a workaround that accesses the iso_read/iso_write methods (private internal APIs) of the libusb1 backend via dev._ctx.handle.It only supports uniform packet lengths due to a limitation within the pyusb backend itself.It safely falls back to a NotSupportedError in environments where the backend cannot be used.Since the AI sandbox lacks physical USB hardware, the isochronous transfers themselves could not be verified on an actual device.
However, I have successfully tested the validation logic, packet-splitting arithmetic, and the success paths using a fake backend.
For this reason, it is explicitly marked as "untested" in the README and CHANGELOG.
Therefore, we cannot guarantee that it will work perfectly; please wait for the next version.