5

Is there a way to access Bluetooth connected devices in browser?

I am trying to build a demo system utilizing leap motion for a university project and was planning to build the interface in HTML because leap motion supports JavaScript.

I want the system to have full control over Bluetooth calling on a phone. As most in-car systems currently do; i.e. accept call, decline, make call & view contacts(if possible)

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Will_P
  • 103
  • 1
  • 3
  • 10

3 Answers3

2

You might want to check out the Chrome Bluetooth API, though it appears you need to have a development version of Chrome installed: https://developer.chrome.com/apps/bluetooth

Benjewman
  • 498
  • 4
  • 14
  • Thanks, yes I was looking at it a little although it seems poorly supported and quite early stages. Was hoping there was a tried and tested option although its unlikely! – Will_P May 12 '14 at 20:31
1

After a trial during January 2017, this is now available in Chrome. Read this article by François Beaufort in developers.google.com: https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web

Chris Allen
  • 605
  • 3
  • 4
0

You can do it with the Bluetooth Web API:

navigator.bluetooth.requestDevice({acceptAllDevices: true}).then(out => console.log(out))

Annoyingly it seems like the browser needs Bluetooth permission, and calling the code above fails with `Bluetooth permission has been blocked otherwise.

To allow bluetooth for macOS, add the app to System Preferences > Security & Privacy > Privacy > Bluetooth > Plus Button: MacOS System Preferences > Security & Privacy > Privacy > Bluetooth > Plus Button

Ben Butterworth
  • 22,056
  • 10
  • 114
  • 167