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

Permission for bluetooth scan #3670

Open
ray007 opened this issue Jul 28, 2023 · 5 comments
Open

Permission for bluetooth scan #3670

ray007 opened this issue Jul 28, 2023 · 5 comments
Assignees
Labels
feature request feature request priority-low We have considered this issue and decided that we will not be able to address it in the near future. tracked We are tracking this work internally.

Comments

@ray007
Copy link

ray007 commented Jul 28, 2023

Description
I know it's an experimental feature which needs to be enabled with

new CoreWebView2EnvironmentOptions("--enable-experimental-web-platform-features");

, but I'd still give out the permission from the code instead of having the user allow it in the dialog.

Version
SDK: 1.0.1901.177
Runtime: 115.0.1901.183
Framework: WPF, but others probably too
OS: Win10

Regression
Not a regression since it's an experimental feature.

Repro Steps
After enabling the experimental web platform features, execute a javascript call

btScan = await navigator.bluetooth.requestLEScan(options);

Screenshots
The dialog shown that I'm trying to avoid is this:
image

Additional context
I tried settings several Permissions to Allow in the profile, and also set up a PermissionRequested handler, but no luck so far.

AB#45930376

@ray007 ray007 added the bug Something isn't working label Jul 28, 2023
@novac42
Copy link
Contributor

novac42 commented Jul 31, 2023

Thanks for reporting the issue and sorry you are running into it. I've assigned this to a dev who can help follow up on this.

@vickiez vickiez assigned vickiez and unassigned vickiez Aug 10, 2023
@vickiez vickiez added tracked We are tracking this work internally. feature request feature request and removed bug Something isn't working tracked We are tracking this work internally. labels Aug 10, 2023
@vickiez vickiez assigned vickiez and victorhuangwq and unassigned vickiez Aug 10, 2023
@victorhuangwq
Copy link
Collaborator

@ray007 Hi ray, can I further understand the following:

  • The context of the app that you are working on
  • The specific scenario that you are trying to achieve. I.e. Why would you like to do bluetooth scan without the dialog?

Thank you!

@ray007
Copy link
Author

ray007 commented Aug 21, 2023

Not sure why the context matters, but all right:
our company sells bluetooth sensors, which also provide data (urls) via bluetooth for use with the building management system.
Sensor data is already used by our mobile app, and we would also like to use it in our windows app, so people with laptops can easier connect to the correct views in the bms for the room they're sitting in.

The permission dialog showed a quite ugly list, after which getting scan advertisements didn't always work.
Which may also be the fault of my usb bluetooth adapter.
But I'd like to show my own styled list for sensors (like I do in our mobile app), or in some cases even automatically connect to the "best".

Independent of context: shouldn't all permissions/dialogs be in the API?

@victorhuangwq
Copy link
Collaborator

victorhuangwq commented Aug 30, 2023

Just to make sure I understand, you would like an API that you can use to create the bluetooth scan UI by yourself? If so, I can understand why you would need an API that allows you to control the underlying functionality of the dialog

Independent of context: shouldn't all permissions/dialogs be in the API?

All Web APIs, like the Web Bluetooth API, are available for you to use. But that triggers the default web dialog, like how it would in Chromium browsers.

For situations where a developer, like yourself, want to bypass the typical browser permission dialogs, we would need to create specific APIs that allow developers to do that.

This issue is already tracked (as per the tag).

@ray007
Copy link
Author

ray007 commented Aug 31, 2023

@victorhuangwq Yes, exactly, I want to create my own UI for showing a list of our sensors to the user.

@github-actions github-actions bot added the priority-low We have considered this issue and decided that we will not be able to address it in the near future. label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request priority-low We have considered this issue and decided that we will not be able to address it in the near future. tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

4 participants