返回综合榜
开发工具与框架Mozilla Hacks

Firefox 宣布支持 Web Serial

桌面版 Firefox 151 现已支持 Web Serial API,Web 应用无需原生软件即可直接与微控制器、开发板、3D 打印机、功率计等串口硬件通信。

兼容设备包括 ESP32 等 Espressif ESP 系列开发板、Raspberry Pi Pico、3D 打印机和 LEGO 设备。Mozilla 与 Adafruit 合作,基于真实硬件工作流测试了该实现;可通过 Adafruit Web Serial Tool 安装 CircuitPython 固件(官方建议使用该工具而非 CircuitPython 网站上的 OPEN INSTALLER 方式),设备上的 Python 程序可通过简单的文本 I/O 与网页交互。示例演示包括 Florian Quèze 从 USB 功率计读取数据并导出到 Firefox Profiler 的工具,以及面向 Home Assistant 的 ESPHome 项目,其固件可通过 Web Serial 几步点击完成安装。

在安全方面,网站在用户通过 navigator.serial.requestPort() 明确授权之前无法获知任何串口,权限按站点和端口分别授予,因此网站无法获取设备列表或有效的指纹信息。Firefox 在端口选择提示之前使用附加说明门控来解释请求,且在企业策略(Firefox Enterprise Policies)下 Web Serial 默认禁用,管理员可通过 DefaultSerialGuardSetting 策略进行控制。

Web Serial 目前仍处于 Web Incubator Community Group(WICG)阶段,但 Mozilla 正通过新的 Workstream 提案推动其在 WHATWG 标准化。用户可在 Mozilla Connect 分享反馈,或在 support.mozilla.org 提交问题。

Announcing Web Serial Support in Firefox

Firefox 151 for Desktop now supports the Web Serial API, allowing web applications to communicate directly with serial-connected hardware such as microcontrollers, development boards, 3D printers, and power meters without native software.

Compatible devices include Espressif ESP-based boards like the ESP32, Raspberry Pi Picos, 3D printers, and LEGO devices. Mozilla collaborated with Adafruit to test the implementation against real hardware workflows; CircuitPython firmware can be installed via the Adafruit Web Serial Tool (recommended over the OPEN INSTALLER method on the CircuitPython site), and Python programs on the device can interoperate with a web page using simple text-based I/O. Demonstrations include Florian Quèze's tool that reads data from a USB power meter and exports it to the Firefox Profiler, and the ESPHome project for Home Assistant, whose firmware can be installed over Web Serial in a few clicks.

For security, websites have no visibility into serial ports until the user explicitly grants access through navigator.serial.requestPort(), with permissions granted per site and per port, so sites do not receive a device list or useful fingerprinting information. Firefox uses add-on gating before the port selection prompt to explain the request, and Web Serial is disabled by default under Firefox Enterprise Policies, controllable via the DefaultSerialGuardSetting policy.

Web Serial still resides in the Web Incubator Community Group (WICG), but Mozilla is pursuing standardization in the WHATWG through a new Workstream proposal. Users can share feedback on Mozilla Connect or file bugs on support.mozilla.org.

FirefoxWeb Serial APIMozillahardwareweb standardsbrowser
综合11
质量90
猎物热度0
时效0
信息来源1 个来源,主来源:Mozilla Hacks

猎鹰不保存原文正文。标题与摘要用于快速发现信息,事实细节请以来源原文为准。

查看来源