[web-bluetooth] Origin is not allowed to access any service.

safeimuslim has just created a new issue for https://github.com/WebBluetoothCG/web-bluetooth:

== Origin is not allowed to access any service. ==
I got error like this, anyone can help?

`Uncaught (in promise) DOMException: Origin is not allowed to access any service. Tip: Add the service UUID to 'optionalServices' in requestDevice() options.`

My code like this
```
/* eslint-disable */
      const device = await window.navigator.bluetooth.requestDevice({
        acceptAllDevices: true,
        optionalService: ['000018f0-0000-1000-8000-00805f9b34fb']
      })
      console.log('DEVICE INFO: ', device.name);
      const server = await device.gatt.connect();
      console.log('server: ', server);
      const service = await server.getPrimaryService('000018f0-0000-1000-8000-00805f9b34fb');
      console.log('service: ', service);
      const characteristic = await service.getCharacteristic("00002af1-0000-1000-8000-00805f9b34fb");
      console.log('service: ', service);
```

Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/410 using your GitHub account

Received on Friday, 28 September 2018 09:43:46 UTC