-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add exclusionFilters to USBDeviceRequestOptions #233
Conversation
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some known devices that are known to not work as expected. Intent to Ship: TODO Spec: WICG/webusb#233 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893
Why do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits. I agree that we probably should unify the behavior between requestDevice()
and the Permissions API integration. Of course the latter is a bit aspirational since it isn't implemented in any browser engine.
index.bs
Outdated
filter</a> in <code>|options|.{{USBPermissionDescriptor/filters}}</code>. | ||
6. Display a prompt to the user requesting they select a device from | ||
7. Remove devices from |enumerationResult| if they do <a>match a device filter</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7. Remove devices from |enumerationResult| if they do <a>match a device filter</a> | |
7. Remove devices from |enumerationResult| if they <a>match a device filter</a> |
index.bs
Outdated
@@ -2370,10 +2389,14 @@ defined as follows: | |||
and |device| does not <a>match a device filter</a> in | |||
<code>|desc|.{{USBPermissionDescriptor/filters}}</code>, continue | |||
to the next |device|. | |||
2. Get the {{USBDevice}} representing |device| and add it to | |||
2. If <code>|desc|.{{USBPermissionDescriptor/exclusionFilters}}</code> | |||
is set and |device| does <a>match a device filter</a> in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is set and |device| does <a>match a device filter</a> in | |
is set and |device| <a>matches a device filter</a> in |
You might need to add an attribute to the definition of "match a device filter" for it to understand this version is the same definition. I forget how smart it is about this.
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: TODO Spec: WICG/webusb#233 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: TODO Spec: WICG/webusb#233 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893
Thank you! I've addressed your nits. Would it be okay to land this as is and file a spec issue to unify the behaviour between |
FYI I've started implementing this change in Chromium at https://chromium-review.googlesource.com/c/chromium/src/+/4614682. Once the spec is updated, I'll start an intent to ship if that looks good to you @reillyeon |
Yes. |
@reillyeon Can you merge? |
SHA: 1ebe98c Reason: push, by reillyeon Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 1ebe98c Reason: push, by reillyeon Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: WICG/webusb#233 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4614682 Reviewed-by: Arthur Sonzogni <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#1161953}
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4614682 Reviewed-by: Arthur Sonzogni <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#1161953}
This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4614682 Reviewed-by: Arthur Sonzogni <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#1161953}
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
…stDeviceOptions, a=testonly Automatic update from web-platform-tests WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392 Change-Id: I1b61d9daae3e14accedb24e493ae656316427893 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4614682 Reviewed-by: Arthur Sonzogni <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#1161953} -- wpt-commits: b7727490c96a87eb3f40fe43f266ad05368ab2b0 wpt-pr: 40582
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
Upstream has done changes to the constructor of `UsbChooserController`. We happen to depend on this class for one of our tests, as way to insert a fake. This change makes the necessary adjustments to reflect the upstream change. Chromium change: https://chromium.googlesource.com/chromium/src/+/19b0f58776f13112c4490e912ff0850b52720a36 commit 19b0f58776f13112c4490e912ff0850b52720a36 Author: François Beaufort <[email protected]> Date: Fri Jun 23 21:18:39 2023 +0000 WebUSB: Add exclusionFilters to USBRequestDeviceOptions This CL adds a new "exclusionFilters" option in navigator.usb.requestDevice() options so that web developers can exclude from the browser picker some devices that are known to not work as expected. Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/e1mgO-m8zvQ Spec: - WICG/webusb#233 - WICG/webusb#235 Demo: https://usb-exclusion-filters.glitch.me/ Bug: 1455392
The new "exclusionFilters" option in
navigator.usb.requestDevice()
allows web developers to exclude some devices from the browser picker. It can be used to exclude devices that match a broader filter but are unsupported, or are already connected for instance.Please have a look @reillyeon
FIX: #232
Preview | Diff