It’s easy to forget the serial connection doesn’t currently work in vanilla Firefox. You end up hammering the “Connect” button, wondering why nothing happens.
The app’s UI should inform the user of this limitation in a suitable way. For example, it could look like this:
var connectButton = document.querySelector(".controls > .desc + button");
// https://developer.chrome.com/docs/capabilities/serial#feature-detection
connectButton.addEventListener("click", function () {
if ( "serial" in navigator ) {
return;
}
alert(
"This app depends upon the Web Serial API, which is unsupported in this web browser.\n\n"
+ "The Web Serial API is known to work in Chrome and Chromium-based browsers. Third-party extensions that add support to other browsers might exist."
);
});
It’s easy to forget the serial connection doesn’t currently work in vanilla Firefox. You end up hammering the “Connect” button, wondering why nothing happens.
The app’s UI should inform the user of this limitation in a suitable way. For example, it could look like this: