Skip to content

Add HIDDevice.forget() method#84

Merged
nondebug merged 3 commits intoWICG:mainfrom
beaufortfrancois:unpair
Jan 7, 2022
Merged

Add HIDDevice.forget() method#84
nondebug merged 3 commits intoWICG:mainfrom
beaufortfrancois:unpair

Conversation

@beaufortfrancois
Copy link
Copy Markdown
Contributor

@beaufortfrancois beaufortfrancois commented Nov 8, 2021

This PR is an attempt to add a way for web developers to revoke permission access to a paired HIDDevice. See #39

// Request a HID device.
const [device] = await navigator.hid.requestDevice({ filters: [] });

// Then later... revoke permission to the HID device.
await device.forget();

@nondebug Please have a look

@beaufortfrancois
Copy link
Copy Markdown
Contributor Author

@nondebug Thanks for reviewing! I've addressed some of your feedback in 32bdda8.

@beaufortfrancois
Copy link
Copy Markdown
Contributor Author

FYI I've started a Chromium CL at https://chromium-review.googlesource.com/c/chromium/src/+/3297868.

</li>
<li>Set |device|.{{HIDDevice/[[state]]}} to `"forgetting"`.
</li>
<li>Invoke the user agent to revoke access to all the [=HID interfaces=]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should reject all pending promises the way that close() does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

@beaufortfrancois
Copy link
Copy Markdown
Contributor Author

@nondebug Shall we merge this PR?

@beaufortfrancois
Copy link
Copy Markdown
Contributor Author

@nondebug I'm about to commit https://chromium-review.googlesource.com/c/chromium/src/+/3297868. Can you merge this spec PR?

aarongable pushed a commit to chromium/chromium that referenced this pull request Jan 7, 2022
This CL adds a way for web developers to revoke permission access to a
paired HIDDevice. The experimental forget() method is behind a blink
runtime feature flag.

Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/c2vCYr-0dqk

Spec: WICG/webhid#84
Bug: 1279822
Change-Id: I29bed5830abddad62e08828827eb68aec8406047
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3297868
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Fr <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/main@{#956442}
@nondebug nondebug merged commit 2fe5627 into WICG:main Jan 7, 2022
github-actions bot added a commit that referenced this pull request Jan 7, 2022
SHA: 2fe5627
Reason: push, by @nondebug

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants