buttplugio / buttplug-rs-ffi

FFI from buttplug-rs to Java and other languages
Other
88 stars 22 forks source link

Buttplug incorrectly states Chrome for Andoird doesn't support the WebBluetooth API #85

Closed DXsmiley closed 2 years ago

DXsmiley commented 2 years ago

Describe the bug Attempting to start scanning on Chrome for Android produces a console log line stating that the WebBluetooth API isn't supported by the browser. You'll need to setup remote debugging in order to see it.

Expected behavior Buttplug should start scanning for devices, since Chrome 91 for Android supports the API.

Additional context Tested on Chrome 91 on a Nokia 5.4 on Android 10. Tested using the version of buttplug hosted at https://cdn.jsdelivr.net/npm/buttplug@1.0.14/dist/web/buttplug.min.js

Minimal example

// Setup
let connector = new Buttplug.ButtplugEmbeddedConnectorOptions();
let client = new Buttplug.ButtplugClient("Example");
await client.connect(connector);

// Needs to be called in the handler of a user interaction (a button press or something)
// due to browser-enforced security reasons
client.startScanning();
dumdum7 commented 2 years ago

Use HTTPS, it works. Tested on Chrome 97. https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice

qdot commented 2 years ago

This was actually an issue in chrome that has since been fixed.