Skip to content

USB.requestDevice new exclusionFilters option #40372

@LostBeard

Description

@LostBeard

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/USB/requestDevice

What specific section or headline is this issue about?

Parameters

What information was incorrect, unhelpful, or incomplete?

The current documentation on MDN incorrectly states the USB requestDevice method takes an array of filters as the only parameter. However, the requestDevice method takes an object with a property filters which is an array.

Current version (minus some bits to make viewable here.)

## Syntax

requestDevice(filters)

### Parameters

- `filters`
  - : An array of filter objects for possible devices you would like to pair. Each filter
    object can have the following properties:
    - `vendorId`
    - `productId`
    - `classCode`
    - `subclassCode`
    - `protocolCode`
    - `serialNumber`

What did you expect to see?

Corrected version (minus some bits to make viewable here.)

## Syntax

requestDevice(options)

### Parameters
- `options`
  - : An object that sets options for selecting an appropriate device.
    The available options are:
    - `filters`
      - : An array of filter objects for possible devices you would like to pair. Each filter
        object can have the following properties:
        - `vendorId`
        - `productId`
        - `classCode`
        - `subclassCode`
        - `protocolCode`
        - `serialNumber`

Do you have any supporting links, references, or citations?

The correct parameters can be seen on the below link that confirms this issue.
Device Enumeration

Do you have anything more you want to share?

I will push a pull request to fix this shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:WebAPIWeb API docsgoal: up-to-date(Experimental label) Issues about outdated content.needs BCD updateRequires changes in BCD mdn/browser-compat-data

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions