W3C home > Mailing lists > Public > public-web-bluetooth-log@w3.org > January 2016

Re: [web-bluetooth] When a device causes a page to open, the page should be able to find the device

From: François Beaufort via GitHub <sysbot+gh@w3.org>
Date: Wed, 06 Jan 2016 11:18:21 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issue_comment.created-169300837-1452079100-sysbot+gh@w3.org>
If we go down the Permissions API road 
(https://lists.w3.org/Archives/Public/public-web-bluetooth/2015Dec/0007.html),
 it would be as simple as adding a `referringDevice` key to the 
Permission object.

```js       
permissions.query({ name: 'bluetooth' })
.then(permission => {
  if (permission.state != 'granted') {
    console.log('User has forbidden websites to use bluetooth...');
    return;
  }
  if (permission.referringDevice) {
    // Let's try to connect to the Physical Web object first. 
    return connectDevice(permission.referringDevice);
  }
  ...

-- 
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at 
https://github.com/WebBluetoothCG/web-bluetooth/issues/163#issuecomment-169300837
 using your GitHub account
Received on Wednesday, 6 January 2016 11:18:24 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 6 January 2016 11:18:24 UTC