Firefox Webserial Addon

https://github.com/kuba2k2/firefox-webserial

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

Run script:

curl -s -L https://raw.githubusercontent.com/kuba2k2/firefox-webserial/master/native/install/linux_x86_64.sh | bash

or install manually

  1. Put the downloaded file in ~/.mozilla/native-messaging-hosts
  2. Rename it to just firefox-webserial.
  3. Make it executable: chmod +x ~/.mozilla/native-messaging-hosts/firefox-webserial.
  4. 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": ["[email protected]"]
    }
    Adjust /home/USER to match your username.
  5. 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
  • 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

MIT License
Copyright (c) 2023 Kuba Szczodrzyński
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"by": "CTOSian",
"descendants": 60,
"id": 40245463,
"kids": [
40247510,
40249296,
40248978,
40250739,
40247439
],
"score": 68,
"time": 1714725057,
"title": "Firefox Webserial Addon",
"type": "story",
"url": "https://github.com/kuba2k2/firefox-webserial"
}
{
"author": "kuba2k2",
"date": null,
"description": "WebSerial API Polyfill for Mozilla Firefox browser - kuba2k2/firefox-webserial",
"image": "https://opengraph.githubassets.com/5d3f03f1ec889bff526c46c2b4e015ae453a4fa2dfedffa328ceda4f0bf9c528/kuba2k2/firefox-webserial",
"logo": "https://logo.clearbit.com/github.com",
"publisher": "GitHub",
"title": "GitHub - kuba2k2/firefox-webserial: WebSerial API Polyfill for Mozilla Firefox browser",
"url": "https://github.com/kuba2k2/firefox-webserial"
}
{
"url": "https://github.com/kuba2k2/firefox-webserial",
"title": "GitHub - kuba2k2/firefox-webserial: WebSerial API Polyfill for Mozilla Firefox browser",
"description": "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...",
"links": [
"https://github.com/kuba2k2/firefox-webserial"
],
"image": "https://opengraph.githubassets.com/5d3f03f1ec889bff526c46c2b4e015ae453a4fa2dfedffa328ceda4f0bf9c528/kuba2k2/firefox-webserial",
"content": "<div><article><p></p><h2>WebSerial for Firefox</h2><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#webserial-for-firefox\"></a><p></p>\n<p>WebSerial API Polyfill for Mozilla Firefox browser</p>\n<p></p><h2>Introduction</h2><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#introduction\"></a><p></p>\n<p>This add-on allows to use the WebSerial API in Firefox.</p>\n<p>It uses a native application to communicate with serial ports.</p>\n<p><strong>NOTE:</strong> Currently, the add-on only works on Windows and Linux (x86-64).</p>\n<p></p><h2>Installation</h2><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#installation\"></a><p></p>\n<p>The add-on is available for download from Mozilla Addons:\n<a target=\"_blank\" href=\"https://addons.mozilla.org/pl/firefox/addon/webserial-for-firefox/\">WebSerial for Firefox</a>.</p>\n<p>The native application needs to be installed on the computer first. The GUI will offer to download the\nnative application when you first try to open a serial port.</p>\n<p></p><h3>Installation on Windows</h3><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#installation-on-windows\"></a><p></p>\n<p>The .exe file is an installer - just open it and install the native application.</p>\n<p></p><h3>Installation on Linux</h3><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#installation-on-linux\"></a><p></p>\n<p>Run script:</p>\n<div><pre>curl -s -L https://raw.githubusercontent.com/kuba2k2/firefox-webserial/master/native/install/linux_x86_64.sh <span>|</span> bash</pre></div>\n<p></p><h4>or install manually</h4><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#or-install-manually\"></a><p></p>\n<ol>\n<li>Put the downloaded file in <code>~/.mozilla/native-messaging-hosts</code></li>\n<li>Rename it to just <code>firefox-webserial</code>.</li>\n<li>Make it executable: <code>chmod +x ~/.mozilla/native-messaging-hosts/firefox-webserial</code>.</li>\n<li>Create a file named <code>io.github.kuba2k2.webserial.json</code> in the same directory, with this content:\n<div><pre>{\n\t<span>\"name\"</span>: <span><span>\"</span>io.github.kuba2k2.webserial<span>\"</span></span>,\n\t<span>\"description\"</span>: <span><span>\"</span>WebSerial for Firefox<span>\"</span></span>,\n\t<span>\"path\"</span>: <span><span>\"</span>/home/USER/.mozilla/native-messaging-hosts/firefox-webserial<span>\"</span></span>,\n\t<span>\"type\"</span>: <span><span>\"</span>stdio<span>\"</span></span>,\n\t<span>\"allowed_extensions\"</span>: [<span><span>\"</span>[email protected]<span>\"</span></span>]\n}</pre></div>\nAdjust <code>/home/USER</code> to match your username.</li>\n<li>Restart the browser and use the extension.</li>\n</ol>\n<p><strong>NOTE:</strong> On Alpine Linux (or other musl-based distros) you will need to have <code>gcompat</code> installed.</p>\n<p></p><h2>Usage</h2><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#usage\"></a><p></p>\n<p>Some applications that can work on Firefox with this add-on:</p>\n<ul>\n<li><a target=\"_blank\" href=\"https://serial.huhn.me/\">Spacehuhn Serial Terminal</a></li>\n<li><a target=\"_blank\" href=\"https://googlechromelabs.github.io/serial-terminal/\">Google Chrome Labs Serial Terminal</a></li>\n<li><a target=\"_blank\" href=\"https://esp.huhn.me/\">ESPWebTool by Spacehuhn</a></li>\n<li><a target=\"_blank\" href=\"https://espressif.github.io/esptool-js/\">ESP Tool by Espressif</a></li>\n<li><a target=\"_blank\" href=\"https://web.esphome.io/\">ESPHome Web</a></li>\n<li><a target=\"_blank\" href=\"https://esphome.github.io/esp-web-tools/\">ESP Web Tools by ESPHome</a></li>\n<li><a target=\"_blank\" href=\"https://ninjaterm.mbedded.ninja/\">NinjaTerm by Geoffrey Hunter</a></li>\n</ul>\n<p></p><h2>Debugging</h2><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#debugging\"></a><p></p>\n<p>To view logs produced by the extension for debugging purposes:</p>\n<ul>\n<li>Open about:debugging, click <code>This Firefox</code></li>\n<li>Find <code>WebSerial for Firefox</code>, click <code>Inspect</code></li>\n<li>Type in the console: <code>window.wsdebug = true</code></li>\n<li>Go to a website of choice, try connecting to a serial port - the console should show extension logs.</li>\n</ul>\n<p></p><h2>License</h2><a target=\"_blank\" href=\"https://github.com/kuba2k2/firefox-webserial#license\"></a><p></p>\n<div><pre><code>MIT License\nCopyright (c) 2023 Kuba Szczodrzyński\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n</code></pre></div>\n</article></div>",
"author": "",
"favicon": "https://github.githubassets.com/favicons/favicon.svg",
"source": "github.com",
"published": "",
"ttr": 89,
"type": "object"
}