flobro / flobro-chrome-app

Chrome app of Flobro, floating browser window
https://chrome.google.com/webstore/detail/faaljkdndnfoagcmhedlmbgieoocemch
MIT License
110 stars 20 forks source link

Requesting support of the WebUSB API #78

Open brockshanson opened 4 years ago

brockshanson commented 4 years ago

Attempting to use the ORYX keyboard configuration/training tool maintained by ZSA technology labs. It appears the Live Training tool uses the WebUSB API (Under the section 'Getting Started with Live Training'). The WEBUSB API appears to be available in Chrome 61 . When attempting to initiate a USB connection from a site in chrome (such as the ORYX live Training website via the 'connect your keyboard' button), the user is prompted to select a USB device from a pop-down window that chrome renders from the omnibox. Windows opened in Flobro do not prompt for USB device selection and immediately fail to a 'No device selected' screen.

Describe the solution you'd like Implement support for the WEBUSB API and allow the connection of USB devices to windows opened in Flobro.

lukescott commented 3 years ago

Same issue and use-case. Poked around a bit, but I don't know a ton about Chrome Apps. Tried something like this, but did not work:

webview.addEventListener('permissionrequest', function(e) {
    if (e.permission === 'download' || e.permission === 'fullscreen' || e.permission === 'usb') {
        e.request.allow();
    }
});
lukescott commented 3 years ago

Not sure if this is possible with how the app currently works. WebUSB requires the Omnibox (the navigation bar). Without it the user can't select a device to pair, so it automatically falls back to a device is not selected error. Apparently there is a similar problem with Electron not having an interface for WebUSB to function.