Fire, I smell FIRE.....
Even with asking the user for input (will that even stick around, or get streamlined out), this is so fraught with risk.
But then, I tend to nobble webUSB, and webBluetooth etc anyway... https://twitter.com/TheRegister/status/1296975264749170689