• Thanks for the link to the issue tracker. So to summarize, reconnecting to already paired devices should be supported in Chrome when using chrome://flags/#enable-web-bluetooth-new-permissions-backend and chrome://flags/#enable-experimental-web-platform-features and this code:

    async function getPermittedBluetoothDevices() {
      let devices = await navigator.bluetooth.getDevices();
      for (let device of devices) {
        // Start a scan for each device before connecting to check that they're in
        // range.
        let abortController = new AbortController();
        await device.watchAdvertisements({signal: abortController.signal});
        device.addEventListener('advertisementreceived', async (evt) => {
          // Stop the scan to conserve power on mobile devices.
          abortController.abort();
     
          // At this point, we know that the device is in range, and we can attempt
          // to connect to it.
          await evt.device.gatt.connect();
        });
      }
    }
    
    

    However, at least on Linux and macOS, the event advertisementreceived is never triggered. Is that an issue with Chrome, the OS or the device? Looks like .watchAdvertisement is supposed to trigger advertisement packages but it doesn't on Linux/macOS?

About

Avatar for user128009 @user128009 started