WICG / webhid

Web API for accessing Human Interface Devices (HID)
Other
143 stars 35 forks source link

Add support for DedicatedWorker #121

Closed beaufortfrancois closed 2 months ago

beaufortfrancois commented 2 months ago

As requested in https://github.com/WICG/webhid/issues/120, this PR exposes the WebHID API in DedicatedWorkerGlobalScope through the WorkerNavigator. It follows the precedent set by WebUSB on Workers and WebHID in Extension Service Workers .

Note that this PR also exposes ServiceWorker for HIDDevice, HIDConnectionEvent, and HIDInputReportEvent that were missed previously in https://github.com/WICG/webhid/commit/f84b8239845ce2dab9481ce157eb074e3f962c68.

beaufortfrancois commented 2 months ago

@nondebug Can you review?

beaufortfrancois commented 2 months ago

Thank you @nondebug! Can you merge this PR so that third_party/blink/web_tests/external/wpt/interfaces/webhid.idl gets automatically updated?

razvanphp commented 2 months ago

should't we do SharedWorker as well in one go? Didn't get the chance to test it with the wheel yet, can do it on monday. Thank you for the quick reaction!

beaufortfrancois commented 2 months ago

I was told to not add shared workers to the spec yet because there are open issues around stuff like Permissions Policy for shared workers.