Skip to main content

Electron 24.0.0

· 7 min read

Electron 24.0.0 已发布!它包含对 Chromium 112.0.5615.49、V8 11.2 和 Node.js 18.14.0 的升级。请阅读下文了解更多详情!

¥Electron 24.0.0 has been released! It includes upgrades to Chromium 112.0.5615.49, V8 11.2, and Node.js 18.14.0. Read below for more details!


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

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

重大变化

¥Breaking Changes

API 更改:nativeImage.createThumbnailFromPath(path, size)

¥API Changed: nativeImage.createThumbnailFromPath(path, size)

maxSize 参数已更改为 size,以反映传入的大小将是创建的缩略图的大小。以前,如果图片小于 maxSize,Windows 不会放大图片,而 macOS 总是将大小设置为 maxSize。现在跨平台的行为是相同的。

¥The maxSize parameter has been changed to size to reflect that the size passed in will be the size the thumbnail created. Previously, Windows would not scale the image up if it were smaller than maxSize, and macOS would always set the size to maxSize. Behavior is now the same across platforms.

// a 128x128 image.
const imagePath = path.join('path', 'to', 'capybara.png');

// Scaling up a smaller image.
const upSize = { width: 256, height: 256 };
nativeImage.createThumbnailFromPath(imagePath, upSize).then((result) => {
console.log(result.getSize()); // { width: 256, height: 256 }
});

// Scaling down a larger image.
const downSize = { width: 64, height: 64 };
nativeImage.createThumbnailFromPath(imagePath, downSize).then((result) => {
console.log(result.getSize()); // { width: 64, height: 64 }
});

新功能

¥New Features

  • 添加了使用 cookies.get() 过滤 HttpOnly Cookie 的功能。#37365

    ¥Added the ability to filter HttpOnly cookies with cookies.get(). #37365

  • shell.openExternal() 选项中添加了 logUsage,允许在 Windows 上将 SEE_MASK_FLAG_LOG_USAGE 标志传递给 ShellExecuteExSEE_MASK_FLAG_LOG_USAGE 标志表示用户发起的启动,可跟踪常用程序和其他行为。#37291

    ¥Added logUsage to shell.openExternal() options, which allows passing the SEE_MASK_FLAG_LOG_USAGE flag to ShellExecuteEx on Windows. The SEE_MASK_FLAG_LOG_USAGE flag indicates a user initiated launch that enables tracking of frequently used programs and other behaviors. #37291

  • 已将 types 添加到 webRequest 过滤器,从而能够过滤你监听的请求。#37427

    ¥Added types to the webRequest filter, adding the ability to filter the requests you listen to.#37427

  • webContents 中添加了新的 devtools-open-url 事件,允许开发者使用它们打开新窗口。#36774

    ¥Added a new devtools-open-url event to webContents to allow developers to open new windows with them. #36774

  • webContents.print() 添加了几个标准页面大小选项。#37265

    ¥Added several standard page size options to webContents.print(). #37265

  • 在会话处理程序 ses.setDisplayMediaRequestHandler() 回调中添加了 enableLocalEcho 标志,以便在 audioWebFrameMain 时允许远程音频输入在本地输出流中回显。#37528

    ¥Added the enableLocalEcho flag to the session handler ses.setDisplayMediaRequestHandler() callback for allowing remote audio input to be echoed in the local output stream when audio is a WebFrameMain. #37528

  • 允许将特定于应用的用户名传递给 inAppPurchase.purchaseProduct()#35902

    ¥Allow an application-specific username to be passed to inAppPurchase.purchaseProduct(). #35902

  • 暴露 window.invalidateShadow() 以清除 macOS 上残留的视觉伪影。#32452

    ¥Exposed window.invalidateShadow() to clear residual visual artifacts on macOS. #32452

  • 现在,Electron 节点头配置文件中默认启用了全程序优化,允许编译器使用程序中所有模块的信息进行优化,而不是逐个模块(编译单元)进行优化。#36937

    ¥Whole-program optimization is now enabled by default in electron node headers config file, allowing the compiler to perform opimizations with information from all modules in a program as opposed to a per-module (compiland) basis. #36937

  • SystemPreferences::CanPromptTouchID (macOS) 现在支持 Apple Watch。#36935

    ¥SystemPreferences::CanPromptTouchID (macOS) now supports Apple Watch. #36935

21.x.y 支持终止

¥End of Support for 21.x.y

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

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

告别 Windows 7/8/8.1 所述,Electron 22(Chromium 108)的计划使用寿命终止日期将从 2023 年 5 月 30 日延长至 2023 年 10 月 10 日。Electron 团队将继续将此计划中的任何安全修复程序反向移植到 Electron 22,直到 2023 年 10 月 10 日。

¥As noted in Farewell, Windows 7/8/8.1, Electron 22's (Chromium 108) planned end of life date will be extended from May 30, 2023 to October 10, 2023. The Electron team will continue to backport any security fixes that are part of this program to Electron 22 until October 10, 2023.

E24 (2023 年 4 月)E25 (2023 年 5 月)E26 (2023 年 8 月)
24.x.y25.x.y26.x.y
23.x.y24.x.y25.x.y
22.x.y23.x.y24.x.y
--22.x.y22.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.