WebSerial for Firefox
WebSerial API Polyfill for Mozilla Firefox browser
Introduction
This add-on allows to use the WebSerial API in Firefox.
It uses a native application to communicate with serial ports.
NOTE: Currently, the add-on only works on Windows and Linux (x86-64).
Installation
The add-on is available for download from Mozilla Addons: WebSerial for Firefox.
The native application needs to be installed on the computer first. The GUI will offer to download the native application when you first try to open a serial port.
Installation on Windows
The .exe file is an installer - just open it and install the native application.
Installation on Linux
Put the downloaded file in ~/.mozilla/native-messaging-hosts Rename it to just firefox-webserial . Make it executable: chmod +x ~/.mozilla/native-messaging-hosts/firefox-webserial . Create a file named io.github.kuba2k2.webserial.json in the same directory, with this content: { "name" : " io.github.kuba2k2.webserial " , "description" : " WebSerial for Firefox " , "path" : " /home/USER/.mozilla/native-messaging-hosts/firefox-webserial " , "type" : " stdio " , "allowed_extensions" : [ " webserial@kuba2k2.github.io " ] } /home/USER to match your username. Restart the browser and use the extension.
NOTE: On Alpine Linux (or other musl-based distros) you will need to have gcompat installed.
Usage
Some applications that can work on Firefox with this add-on:
Debugging
To view logs produced by the extension for debugging purposes:
Open about:debugging, click This Firefox
Find WebSerial for Firefox , click Inspect
, click Type in the console: window.wsdebug = true
Go to a website of choice, try connecting to a serial port - the console should show extension logs.
License