Extend Origin Trial: Serial API

29 views
Skip to first unread message

Reilly Grant

unread,
Apr 2, 2020, 7:31:48 PM4/2/20
to blink-dev

Contact emails

rei...@chromium.org


Spec

https://wicg.github.io/serial/


Summary

The Serial API provides an interface for connecting to serial devices, either through a serial port on the user’s system or removable USB and Bluetooth devices that emulate a serial port. This API has been requested by the hardware developer community, especially developers building educational tools, as a companion to the WebUSB API because operating systems require applications to communicate with USB-based serial ports using their higher-level serial API rather than the low-level USB API. It also supports non-USB serial ports.


An Origin Trial for the Serial API started in Chrome 80 and was scheduled to end in Chrome 82. We have seen high developer engagement in this trial, with 46 origins requesting keys. Feedback is positive, with developers emphasizing that this is allowing them to write applications for the web that they would otherwise need to build as native software.


We intend to begin another Origin Trial in Chrome 83 (the Chrome 82 release is being skipped). This trial will include new features added since the original trial, such as the ability to filter ports by USB vendor and product IDs and the ability to register for device connect and disconnect events.


Some features, such as the ability to flush and drain port buffers, remember permissions persistently, and control permissions via enterprise policy controls are not yet implemented and will be built over the course of the trial.


Link to “Intent to Prototype” blink-dev discussion

https://groups.google.com/a/chromium.org/d/msg/blink-dev/GcqEnSW5yHs/r7G3iMmDCQAJ


Goals for experimentation

The goal for continuing this experiment is to allow developers to continue to experiment with a pre-release version of this API while it is still not feature complete. Public sites such as espruino.com/ide have already deployed code to take advantage of this trial while it is in this experimental phase.


We seek feedback from developers on the current shape of the API and the features that have been added since the first release.


Experimental timeline

The experiment will run from Chrome 83 through Chrome 85.


Any risks when the experiment finishes?

This API allows sites to deprecate alternative solutions for communicating with hardware devices, such as requiring a local WebSocket server to service as a bridge to the native operating system API. Sites experimenting with the Serial API should not remove support for these existing methods until it is fully shipped. New sites built without a fallback mechanism should be aware that this is experimental functionality that is not guaranteed to be available after the experiment ends.


Reason this experiment is being extended

This experiment is being extended because the API is not complete and there are new features added since the first release for which we are seeking developer experience.


Previous "Intent to Experiment" discussion: https://groups.google.com/a/chromium.org/d/msg/blink-dev/AiGJihoCbl4/OmA24108DwAJ


Ongoing technical constraints

None.


Debuggability

Developers are able to debug scripts using this feature using the existing DevTools console and debugger. For debugging device communication issues it is often convenient to use the ReadableStream.tee() method to split the streams going to or from the device and print them to the console for inspection.


Will this feature be supported on all five Blink platforms supported by Origin Trials (Windows, Mac, Linux, Chrome OS, and Android)?

This feature will be available on all desktop platforms (Windows, macOS, Linux and Chrome OS). It will not be available on Android or Android WebView because the Android platform SDK does not include support for serial ports. Android support for USB-based serial ports is possible using the WebUSB API and a polyfill. The permissions UX will be essentially the same for either API.


Link to entry on the feature dashboard

https://chromestatus.com/feature/6577673212002304

Yoav Weiss

unread,
Apr 3, 2020, 3:41:32 AM4/3/20
to Reilly Grant, blink-dev
LGTM

Glad to hear the OT is seeing high engagement!
Do I understand correctly that you expect the feature to be complete by M85, allowing your partners to fully test it before the trial ends?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAEmk%3DMZbeSkx8vhtFnME7_%2BQPVBb_aFQiH0XAQmn7C2y5WAk3g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages