Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Bluetooth device chooser doesn't work since 0.75 #8160

Open
Scavanger opened this issue Jan 22, 2024 · 0 comments
Open

[BUG] Bluetooth device chooser doesn't work since 0.75 #8160

Scavanger opened this issue Jan 22, 2024 · 0 comments

Comments

@Scavanger
Copy link

Scavanger commented Jan 22, 2024

Issue Type

Since V 0.75 the Bluetooth functionality seems to be broken.

The small example app below works perfectly until nw.js 0.74, from 0.75 onwards instead of the bluetooth device chooser of Chrome the error message appears: "Error: NotFoundError: User cancelled the requestDevice() chooser."

Expected/Proposed Behavior

Bluetooth device chooser shows up

Additional Info

  • Operating System: WIN 11

  • NW.js Version: since 0.75

  • Code snippet:

package.json:

{
  "name": "BLE Test",
  "description": "BLE Test",
  "version": "0.0.1",
  "main": "main.html",
  
  "scripts": {
    "start": "node node_modules/nw/bin/nw .",
    "nw": "nw"
  },
  
  "dependencies": {
    "nw": "^0.75.0"
  }
}

main.html:

<!DOCTYPE html>
<html>
<head>
<script>
function bleTest() {
  navigator.bluetooth.requestDevice({
  filters: [{ services: ['generic_attribute'] }],
        })
  .then(device => {
    alert('> Name: ' + device.name + '\nID: ' + device.id + '\n: ' + device.gatt.connected);
  })
  .catch(error => {
    alert('Error: ' + error);
  });
}
</script>
</head>
<body>
<h2>nw.js BLE Test</h2>

<p id="demo">BLE Test</p>
<button type="button" onclick="bleTest()">Test it</button>

</body>

</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant