Skip to main content

Electron 31.0.0

· 7 min read

Electron 31.0.0 已发布!它包含对 Chromium 126.0.6478.36、V8 12.6 和 Node 20.14.0 的升级。

¥Electron 31.0.0 has been released! It includes upgrades to Chromium 126.0.6478.36, V8 12.6, and Node 20.14.0.


Electron 团队非常高兴地宣布 Electron 31.0.0 正式发布!你可以通过 npm install electron@latest 使用 npm 安装它,也可以从我们的 发布网站。继续阅读以了解有关此版本的详细信息。

¥The Electron team is excited to announce the release of Electron 31.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.

如果你有任何反馈,请在 TwitterMastodon 上与我们分享,或加入我们的社区 Discord!可以在 Electron 的 问题跟踪器 中报告错误和功能请求。

¥If you have any feedback, please share it with us on Twitter or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

显著变化

¥Notable Changes

亮点

¥Highlights

  • 扩展 WebContentsView 以接受预先存在的 webContents 对象。#42319

    ¥Extended WebContentsView to accept pre-existing webContents object. #42319

  • 添加了对 NODE_EXTRA_CA_CERTS 的支持。#41689

    ¥Added support for NODE_EXTRA_CA_CERTS. #41689

  • 更新了 window.flashFrame(bool),使其在 macOS 上持续闪烁。#41391

    ¥Updated window.flashFrame(bool) to flash continuously on macOS. #41391

  • 移除 WebSQL 支持 #41868

    ¥Removed WebSQL support #41868

  • nativeImage.toDataURL 会保留 PNG 颜色空间 #41610

    ¥nativeImage.toDataURL will preserve PNG colorspace #41610

  • 扩展 webContents.setWindowOpenHandler 以支持手动创建 BrowserWindow。#41432

    ¥Extended webContents.setWindowOpenHandler to support manual creation of BrowserWindow. #41432

技术栈变更

¥Stack Changes

Electron 31 将 Chromium 从 124.0.6367.49 升级到 126.0.6478.36,将 Node 从 20.11.1 升级到 20.14.0,将 V8 从 12.4 升级到 12.6

¥Electron 31 upgrades Chromium from 124.0.6367.49 to 126.0.6478.36, Node from 20.11.1 to 20.14.0, and V8 from 12.4 to 12.6.

新功能

¥New Features

  • Session 添加了 clearData 方法。#40983

    ¥Added clearData method to Session. #40983

    • Session.clearData API 添加了 options 参数。#41355

      ¥Added options parameter to Session.clearData API. #41355

  • navigator.serial 中添加了对通过服务类别 ID 请求蓝牙端口的支持。#41638

    ¥Added support for Bluetooth ports being requested by service class ID in navigator.serial. #41638

  • 添加了对 Node 的 NODE_EXTRA_CA_CERTS 环境变量的支持。#41689

    ¥Added support for Node's NODE_EXTRA_CA_CERTS environment variable. #41689

  • 扩展 webContents.setWindowOpenHandler 以支持手动创建 BrowserWindow。#41432

    ¥Extended webContents.setWindowOpenHandler to support manual creation of BrowserWindow. #41432

  • 实现了对 Web 标准 文件系统 API 的支持。#41419

    ¥Implemented support for the web standard File System API. #41419

  • 扩展 WebContentsView 以接受预先存在的 WebContents 实例。#42319

    ¥Extended WebContentsView to accept pre-existing WebContents instances. #42319

  • 在 webContents API 中,通过 navigationHistory.getEntryAtIndex 方法添加了新的实例属性 navigationHistory,使应用能够检索浏览历史记录中任何导航条目的 URL 和标题。#41577 2930 中也支持)

    ¥Added a new instance property navigationHistory on webContents API with navigationHistory.getEntryAtIndex method, enabling applications to retrieve the URL and title of any navigation entry within the browsing history. #41577 (Also in 29, 30)

重大变化

¥Breaking Changes

删除:WebSQL 支持

¥Removed: WebSQL support

Chromium 已删除对 WebSQL 上游的支持,仅将其转换为 Android。请参阅 Chromium 有意删除讨论 了解更多信息。

¥Chromium has removed support for WebSQL upstream, transitioning it to Android only. See Chromium's intent to remove discussion for more information.

行为改变:nativeImage.toDataURL 将保留 PNG 色彩空间

¥Behavior Changed: nativeImage.toDataURL will preseve PNG colorspace

PNG 解码器实现已更改,以保留色彩空间数据。此函数返回的编码数据现在与其匹配。

¥PNG decoder implementation has been changed to preserve colorspace data. The encoded data returned from this function now matches it.

请参阅 crbug.com/332584706 了解更多信息。

¥See crbug.com/332584706 for more information.

行为改变:win.flashFrame(bool) 将在 macOS 上持续闪烁 Dock 图标

¥Behavior Changed: win.flashFrame(bool) will flash dock icon continuously on macOS

这使行为与 Windows 和 Linux 保持一致。先前行为:第一个 flashFrame(true) 仅弹跳一次停靠图标(使用 NSInformationalRequest 级别),flashFrame(false) 不执行任何操作。新行为:持续闪烁,直到调用 flashFrame(false)。这改为使用 NSCriticalRequest 级别。要明确使用 NSInformationalRequest 来引起单个停靠图标弹跳,仍然可以使用 dock.bounce('informational')

¥This brings the behavior to parity with Windows and Linux. Prior behavior: The first flashFrame(true) bounces the dock icon only once (using the NSInformationalRequest level) and flashFrame(false) does nothing. New behavior: Flash continuously until flashFrame(false) is called. This uses the NSCriticalRequest level instead. To explicitly use NSInformationalRequest to cause a single dock icon bounce, it is still possible to use dock.bounce('informational').

28.x.y 支持终止

¥End of Support for 28.x.y

Electron 28.x.y 已根据项目 支持政策 终止支持。建议开发者和应用升级到较新版本的 Electron。

¥Electron 28.x.y has reached end-of-support as per the project's support policy. Developers and applications are encouraged to upgrade to a newer version of Electron.

E31 (2024 年 6 月)E32 (2024 年 8 月)E33 (2024 年 10 月)
31.x.y32.x.y33.x.y
30.x.y31.x.y32.x.y
28.x.y29.x.y31.x.y

下一步计划

¥What's Next

短期内,你可以预期团队将继续专注于跟上构成 Electron 的主要组件(包括 Chromium、Node 和 V8)的开发。

¥In the short term, you can expect the team to continue to focus on keeping up with the development of the major components that make up Electron, including Chromium, Node, and V8.

你可以找到 Electron 公开时间线

¥You can find Electron's public timeline here.

有关未来变更的更多信息,请参阅 计划中的突发事件变更 页面。

¥More information about future changes can be found on the Planned Breaking Changes page.