webusb / arduino

WebUSB demos running on Arduino (and compatible) hardware.
566 stars 152 forks source link

Update code to match changes in the spec #30

Closed prusnak closed 6 years ago

prusnak commented 7 years ago

I am talking mainly about changes in the Feature Policy here: https://github.com/WICG/webusb/commit/c9646137abd41606982c5cf2703ac42629e34616 (removal of GET_ALLOWED_ORIGINS, etc.)

But maybe some other changes in the spec are relevant for this example (which is a go-to point for reference code of all hardware vendors implementing the spec).

reillyeon commented 7 years ago

I have a patch which does this however due to a bug in Chrome I will be waiting a little bit before merging it.

prusnak commented 7 years ago

I am confused. You are talking about removal of GET_ALLOWED_ORIGINS, https://github.com/WICG/webusb/commit/c9646137abd41606982c5cf2703ac42629e34616 also talks about the removal, yet this comment says it is optional. What is the state of GET_ALLOWED_ORIGINS? It is optional now and will be removed completely in the future?

reillyeon commented 7 years ago

Before WICG/webusb@c964613 GET_ALLOWED_ORIGINS was required by the spec and in Chrome. In Chrome 57 and 58 it started to be ignored when making permission decisions for top-level frames however due to this issue it wasn't completely optional because without it Chrome wouldn't bother reading the landing page URL. Now that that issue is fixed and will be rolling out in Chrome 59 devices truly don't have to implement it anymore. The optional state was a decision within Chrome that was not reflected in the specification. I am currently landing a patch that brings Chrome up to date with the specification.

prusnak commented 6 years ago

Is BOS descriptor still required? If not, can we please further reduce the example not to include it?

reillyeon commented 6 years ago

The BOS descriptor is optional. We will continue to include both the WebUSB and Microsoft BOS capability descriptors in this example as they provide an improved user experience by informing the browser of a landing page for the device and informing Windows that the winusb.sys driver should be loaded.