Electron & Web Bluetooth : Device chooser not shown


#1

Hello,

I would like to develop an application which communicate with BLE devices.
I use the Chrome WebBluetooth API, and it works great inside Chrome, but not in Electron.

When we launch a scan, Chrome display a popup for selecting the device. This device chooser is not displayed in Electron. Nothing happen on a scan, and if we click outside, we have a log saying we abort the scan (like if we click outside the device chooser).

So, it’s a bug or a missing functionnality?
Is there a way to bypass this device chooser?

Thanks in advance!


#2

If you want to test, just go to this page, and click on “Get Bluetooth Device Info” : https://googlechrome.github.io/samples/web-bluetooth/device-info.html?allDevices=true

You need to activate bluetooth in chrome : chrome://flags -> #enable-experimental-web-platform-features
And in Electron : app.commandLine.appendSwitch(‘enable-experimental-web-platform-features’, true);