chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.24k stars 455 forks source link

WebHID API support #2847

Closed magreenblatt closed 3 years ago

magreenblatt commented 4 years ago

Original report by Onur Turan (Bitbucket: Flashh, GitHub: Flashh).


Chome 78+ allows access to the WebHID API. CEF lets us set this flag. when we add this runtime flag “enable-experimental-web-platform-features” at runtime, we can access the WebHID API functions. But there's a problem. I want to show you an example; After running the code line "navigator.hid.requestDevice ({filters: []}" on CEF, no device pairing screen came up. If this screen fails, the devices cannot be paired. As a result, no WebHID API will work. When you run the line "let devices = navigator.hid.getDevices (). then ((data) => console.log (data))", an empty array will return because the devices are not paired.

Additional Information;
Chome also implements a device picker for granting HID device permissions. I understand that CEF isn't likely going to implement a UI for picking HID devices (similar to WebUSB and bluetooth). We would need a way to blanket authorize all connected HID devices so that we can retrieve them with the getDevices() function in the WebHID API. Normally the returned array is empty until the user has explicitly granted device permissions.

As a result; The WebHID API is not available in CEF because no device pairing screen came up. If we do not pair the device, the functions of this API are not available. Normally this screen should come or can grant blanket access for all HID devices. This needs to be implemented by CEF.

magreenblatt commented 4 years ago

See also issue #2582 for general permissions support.

magreenblatt commented 3 years ago

This should currently work with the Chrome runtime. We will likely not support this with the Alloy runtime.

magreenblatt commented 4 years ago
magreenblatt commented 4 years ago

Original changes by Onur Turan (Bitbucket: Flashh, GitHub: Flashh).


magreenblatt commented 3 years ago