Skip to content

WebUSB API #68

Closed
Closed

Description

@nondebug

(Re-)request for position on an emerging web specification

Information about the spec

Design reviews and vendor positions

Anything else we need to know

WebKit declined to implement several APIs, including WebUSB, due to concerns over fingerprinting:

https://webkit.org/tracking-prevention/

I'm re-requesting WebKit's position on this emerging web specification because of changes we are making to the Chromium implementation related to deprecation of extension background pages in manifest V3. We plan to expose WebUSB to extension service workers as a migration path for extensions that currently access the API from the extension background page.

Chrome Platform Status: https://chromestatus.com/feature/5200265459269632
Explainer: https://github.com/nondebug/webusb/blob/service-worker-explainer/extension-service-worker-explainer.md

Even though Apple is not considering implementing this API, we are still interested in any feedback WebKit can provide on WebUSB and our proposal to integrate with Service Workers.

Activity

  1. marcoscaceres commented on Sep 28, 2022

    @marcoscaceres
    Contributor

    Thanks @nondebug! We will take a look and get back to you as soon as we can.

  2. added
    concerns: privacy
    concerns: security
    topic: web apis
    topic: device apis
    topic: app-like capabilities
    concerns: device independence
    on Oct 7, 2022
  3. othermaciej commented on Oct 7, 2022

    @othermaciej

    It takes some indirection to tell from the Mozilla standards position issue, but Mozilla has judged this API "harmful", primarily for security reasons.

  4. added
    venue: WICG
    from: Google
    on Oct 7, 2022
  5. othermaciej commented on Oct 10, 2022

    @othermaciej

    We have previously stated privacy concerns, thus the concerns: privacy label. We agree with Mozilla's security concerns raised in their standards position issue, thus the concerns: security label. This spec also depends on a specific hardware technology, and enables dependency on specific attached hardware accessories, which risks the device independence of the web; thus concerns: device-independence.

  6. reillyeon commented on Oct 10, 2022

    @reillyeon

    Two questions for the WebKit team on whether there are changes that could be made to this API that would affect your position:

    1. The work that @nondebug is currently doing refers specifically to the use of WebUSB in browser extensions, not the "drive by" web. Given that developing an extension typically involves submitting it for review by a browser vendor I am curious if WebKit would consider this to mitigate some of the security and privacy concerns?

    2. The device independence concern is interesting because in my mind the purpose of this API is to enable innovative new hardware, which implies that by design applications will be built for particular devices. Eventually such devices could become common but everything is cutting-edge at some point. Disregarding the specific technologies for the moment, what is WebKit's position on providing communication between a site and a local peripheral?

  7. othermaciej commented on Oct 11, 2022

    @othermaciej

    Maybe we need separate issues for WebUSB for the web vs WebUSB for extensions. It is indeed possible we might endorse this standards proposal in extensions even if not on websites. I took this issue to be about WebUSB in general, and it’s fair that we should get our position on the record on that.

  8. nondebug commented on Oct 11, 2022

    @nondebug
    Author

    Thanks, I've filed a separate issue for the extension behavior.

  9. 4 remaining items

  10. annevk commented on Apr 30, 2025

    @annevk
    Contributor

    Given the concerns mentioned in #68 (comment) I suggest we resolve this as "position: oppose" four weeks from now. Four weeks because it's been such a long time already.

    Disregarding the specific technologies for the moment, what is WebKit's position on providing communication between a site and a local peripheral?

    This seems a bit off-topic, but I suspect that if the details of the connection are sufficiently abstracted such that they can change over time, there might be a way forward there.

  11. reillyeon commented on Apr 30, 2025

    @reillyeon

    The question is relevant because if we abstract the discussion away from a particular transport like Bluetooth, USB, Ethernet or WiFi then we find that WebKit does support communication between websites and local peripherals in some circumstances, as long as they provide an HTTP network endpoint. What I'm trying to understand, as a policy position, is where on the spectrum from embedded HTTP server to USB device does the WebKit team find that the security and privacy concerns creep in. What would have to change about the way that the browser handshakes with the USB device for such communication to be considered as safe as making an HTTP connection? For example, an earlier draft of the WebUSB specification provided a way to effectively serve CORS headers from a USB device. Would that be sufficient to demonstrate that a USB device intended to be reachable from a web origin?

  12. annevk commented on Apr 30, 2025

    @annevk
    Contributor

    There might still be security and privacy considerations, but something of that nature would at least significantly reduce the device independence concerns as well as becoming more portable.

  13. reillyeon commented on Apr 30, 2025

    @reillyeon

    Can you elaborate?

  14. annevk commented on Jun 6, 2025

    @annevk
    Contributor

    A difference with a local HTTP server is that you are then directly communicating with the "authority" of the device whereas with Web USB it's some other "authority" that executes commands on your device. The former is also already deployed and supported, e.g., with routers.

    Closing this as "position: oppose" per rationale provided earlier.

  15. gfwilliams commented on Oct 22, 2025

    @gfwilliams

    As a company that ships products using Web USB/Web Serial and finds it amazingly valuable, I'd just like to add my thoughts:

    Developing and maintaining native apps for all platforms is very difficult especially for a small developer, and it's pretty much impossible to be an expert on all platforms at once. As as result hardware manufacturers are developing native, un-sandboxed apps for every platform which likely have security/privacy issues, and are requiring their users to install those apps in order to use the hardware they purchased.

    ... and that's assuming manufacturers aren't deliberately infecting apps with adware as an extra revenue stream or reporting back constant "usage stats".

    So while you can argue that Web USB adds a small increased risk to privacy in-browser, I feel that the privacy benefits of not forcing the user to install native apps far outweight that.

  16. reillyeon commented on Oct 23, 2025

    @reillyeon

    A difference with a local HTTP server is that you are then directly communicating with the "authority" of the device whereas with Web USB it's some other "authority" that executes commands on your device. The former is also already deployed and supported, e.g., with routers.

    Based on this it sounds like my proposal above to have the device declare which origins it will accept commands from would provide the necessary "authority" in the same way that an HTTP server can permit requests through the Access-Control-Allow-Origin header.

  17. annevk commented on Oct 23, 2025

    @annevk
    Contributor

    Looking back on this thread when I wrote

    There might still be security and privacy considerations, but something of that nature would at least significantly reduce the device independence concerns as well as becoming more portable.

    I strongly suspect that was more about the general gist of having some device-independent abstraction and not about the specific suggestion of a CORS-like handshake for USB specifically. (It's hard to say for sure many months later.) Looking at it now that particular idea might alleviate some of the security concerns, but not device independence or portability.

  18. reillyeon commented on Oct 23, 2025

    @reillyeon

    That makes sense to me. That mitigation it targeted at the security concerns. Writing an application to communicate with a custom device over any protocol would introduce device independence concerns. I assume that beyond that you have a concern here that this API specifically addresses USB communication rather than providing a general communication protocol. I see similar concerns were raised for the WebTransport API.

  19. jonathancaudill commented on Nov 13, 2025

    @jonathancaudill

    I recognize that this is closed, but I'm chiming in to mention that there are many other frameworks and developing web technologies that pose far greater user security risks (agentic web browsing being the main one) than WebUSB. As the maintainer of a WebKit-based browser, I would think WebUSB would be a positive thing to integrate long-term, depending on the shape it takes going forward.

    Plenty of newer computing peripherals are shipping with software that must be updated over WebUSB to avoid having to maintain an companion app. See here.

    I think this API is worth revisiting, especially if this trend continues in the coming years--in my opinion, the average (non-technical) computer user should only need one browser 99.9% of the time.

  20. marcoscaceres commented on Nov 26, 2025

    @marcoscaceres
    Contributor

    It almost seems like the primary use case for WebUSB seems to be firmware updates? At least, that's what I keep hearing from folks I speak to.

    Not saying this would fly, but perhaps considering reducing the scope of the API to what developers are primarily using it for, along with an appropriate permissions model might help? Dunno... but worth thinking about.

  21. JackDunnCodes commented on Nov 26, 2025

    @JackDunnCodes

    Heya, been following this issue for a while - as a web dev WebUSB seems like an exciting technology. Just thought I'd chime in with a few in-the-wild use cases:

    There are interesting use cases outside of just firmware for WebUSB - and, on a personal level, I would be disappointed for the API to be limited in such a way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

concerns: device independenceconcerns: privacyconcerns: securityfrom: Googleposition: opposetopic: app-like capabilitiestopic: device apistopic: web apisvenue: WICG

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions