Re: [web-bluetooth] Consider devicechange event for when a new granted bluetooth device is made available,

For the sake of completeness, is this how it would work?

```js
navigator.permissions.query({
  name: "bluetooth",
  deviceId: sessionStorage.lastDevice /* because we've stored it 
previously */
}).then(result => {
  result.addEventListener('change', function(event) {
    // Permission status has changed for this device
    console.log(event.target);
  })
})
```

If `result.devices` were to return multiple devices, would there be 
multiple events fired for each device?

Is this how do I access a newly paired `BluetoothDevice` object with 
this `change`  triggered event?
```js
navigator.permissions.query({
  name: "bluetooth",
  optionalServices: [ 'battery_service' ], 
}).then(result => {
  result.addEventListener('change', function(event) {
    console.log(event.target); /* Is this BluetoothDevice?
  })
})
```

@jyasskin Sorry for this, I'm still having hard time getting the full 
`Permissions` API scope for Web Bluetooth. 

-- 
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/issues/257#issuecomment-237772455
 using your GitHub account

Received on Friday, 5 August 2016 07:07:30 UTC