W3C home > Mailing lists > Public > public-web-bluetooth-log@w3.org > September 2018

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

From: safei muslim via GitHub <sysbot+gh@w3.org>
Date: Fri, 28 Sep 2018 09:43:44 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issues.opened-364816359-1538127818-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:58:26 UTC