-
Notifications
You must be signed in to change notification settings - Fork 49
Description
On MacOS it is becoming more and more difficult to install kernel extensions, and their successor since Catalina, driver extensions. It can also be challenging to get a DriverKit entitlement in order to write a driver extension. Apple includes built-in kernel/driver extensions for a number of chipsets, but not all, and these also don't work if the device has a custom USB PID/VID.
Luckily, if there is no existing USB serial port driver installed, MacOS will load the default USB driver, which can be accessed over WebUSB. I have written a bunch of JS user-space drivers for FTDI, Texas Instruments, Silicon Labs and Prolific chipsets, and these work well as a fallback mechanism.
However, It does lead to a confusing user experience, where we first have to display the Web Serial permission prompt in case there is a USB driver already installed, and then display the WebUSB permission prompt when the user presses Cancel (as the Web Serial API doesn't find any devices) so that we can then connect using WebUSB instead.
Could there be away to make Web Serial a little bit more aware of WebUSB, for example by providing a new method that would automatically fall back to navigator.usb.requestDevice
when navigator.serial.requestPort
comes up empty?