Skip to main content

Electron 23.0.0

· 6 min read

Electron 23.0.0 已发布!它包含对 Chromium 110、V8 11.0 和 Node.js 18.12.1 的升级。此外,对 Windows 7/8/8.1 的支持已停止。请阅读下文了解更多详情!

¥Electron 23.0.0 has been released! It includes upgrades to Chromium 110, V8 11.0, and Node.js 18.12.1. Additionally, support for Windows 7/8/8.1 has been dropped. Read below for more details!


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

¥The Electron team is excited to announce the release of Electron 23.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.

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

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

显著变化

¥Notable Changes

技术栈变更

¥Stack Changes

新功能

¥New Features

  • Display 对象中添加了 label 属性。#36933

    ¥Added label property to Display objects. #36933

  • 添加了一个 app.getPreferredSystemLanguages() API 来返回用户的系统语言。#36035

    ¥Added an app.getPreferredSystemLanguages() API to return the user's system languages. #36035

  • 添加了对 WebUSB API 的支持。#36289

    ¥Added support for the WebUSB API. #36289

  • 添加了对 SerialPort.forget() 的支持,以及在给定来源被撤销时在 会议 对象上发出的新事件 serial-port-revoked#35310

    ¥Added support for SerialPort.forget() as well as a new event serial-port-revoked emitted on Session objects when a given origin is revoked. #35310

  • 添加了新的 win.setHiddenInMissionControl API,允许开发者在 macOS 上选择退出 Mission Control。#36092

    ¥Added new win.setHiddenInMissionControl API to allow developers to opt out of Mission Control on macOS. #36092

放弃对 Windows 7/8/8.1 的支持

¥Dropping Windows 7/8/8.1 Support

Electron 23 不再支持 Windows 7/8/8.1。Electron 遵循计划中的 Chromium 弃用政策,该政策将于 弃用 Windows 7/8/8.1 以及 Windows Chromium 109 支持 Server 2012 和 2012 R2(点击此处了解更多信息)

¥Electron 23 no longer supports Windows 7/8/8.1. Electron follows the planned Chromium deprecation policy, which will deprecate Windows 7/8/8.1 , as well as Windows Server 2012 and 2012 R2 support in Chromium 109 (read more here).

API 重大变更

¥Breaking API Changes

以下是 Electron 23 中引入的重大变更。你可以在 计划中的突发事件变更 页面上阅读有关这些更改和未来更改的更多信息。

¥Below are breaking changes introduced in Electron 23. You can read more about these changes and future changes on the Planned Breaking Changes page.

删除:BrowserWindow scroll-touch-* 事件

¥Removed: BrowserWindow scroll-touch-* events

BrowserWindow 上已弃用的 scroll-touch-beginscroll-touch-endscroll-touch-edge 事件已被删除。请使用 WebContents 上新推出的 input-event 事件。

¥The deprecated scroll-touch-begin, scroll-touch-end and scroll-touch-edge events on BrowserWindow have been removed. Instead, use the newly available input-event event on WebContents.

// Removed in Electron 23.0
-win.on('scroll-touch-begin', scrollTouchBegin)
-win.on('scroll-touch-edge', scrollTouchEdge)
-win.on('scroll-touch-end', scrollTouchEnd)

// Replace with
+win.webContents.on('input-event', (_, event) => {
+ if (event.type === 'gestureScrollBegin') {
+ scrollTouchBegin()
+ } else if (event.type === 'gestureScrollUpdate') +{
+ scrollTouchEdge()
+ } else if (event.type === 'gestureScrollEnd') {
+ scrollTouchEnd()
+ }
+})

20.x.y 支持终止

¥End of Support for 20.x.y

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

¥Electron 20.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.

E22 (2022 年 11 月)E23 (2023 年 2 月)E24 (2023 年 4 月)E25 (2023 年 5 月)E26 (2023 年 8 月)
22.x.y23.x.y24.x.y25.x.y26.x.y
21.x.y22.x.y23.x.y24.x.y25.x.y
20.x.y21.x.y22.x.y23.x.y24.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.