nw.js
nw.js copied to clipboard
Protected USB device (on M1 Mac) is not visible despite disabling WebUSB Security.
I was just trying out the M1 Darwin release, and everything seems fine with it, except WebUSB. I don't know if this is a problem in NWJS generally, or just the M1 build.
I have this package.json
file:
{
"name": "dspj",
"main": "index.html",
"chromium-args": "--disable-webusb-security"
}
My index.html
file just loads a JS module at the end of an otherwise empty body, like this:
<script type=module src=./static/main.js></script>
The main.js
file just contains this code:
const browser = nw.Window.get();
const devices = await navigator.usb.getDevices();
browser.showDevTools();
console.log(devices);
The code executes, no problem, but the array (of USB devices) is empty, even though I have a USB device plugged in (a Novation Launchpad X). That device is protected (as are all audio class devices), but with the --disable-webusb-security
flag, it should show up.
You can likely reproduce this issue using any USB device that would be protected otherwise.