Skip to main content

Electron 24.0.0

· 6 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 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。

🌐 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.

技术栈变更

🌐 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 cookies 的功能。 #37365
  • 已将 logUsage 添加到 shell.openExternal() 选项,这允许在 Windows 上将 SEE_MASK_FLAG_LOG_USAGE 标志传递给 ShellExecuteExSEE_MASK_FLAG_LOG_USAGE 标志表示用户启动,这使得可以跟踪经常使用的程序和其他行为。 #37291
  • 已将 types 添加到 webRequest 过滤器中,增加了过滤你监听的请求的功能。#37427
  • webContents 中添加了一个新的 devtools-open-url 事件,以允许开发者使用它们打开新窗口。#36774
  • webContents.print() 添加了几个标准页面大小选项。 #37265
  • 在会话处理器 ses.setDisplayMediaRequestHandler() 回调中添加了 enableLocalEcho 标志,以允许在 audioWebFrameMain 时将远程音频输入回显到本地输出流。#37528
  • 允许将特定于应用的用户名传递给 inAppPurchase.purchaseProduct()#35902
  • 在 macOS 上暴露 window.invalidateShadow() 以清除残留的视觉痕迹。 #32452
  • 在 electron 节点头文件配置中,现在默认启用了全程序优化,使编译器能够基于程序中所有模块的信息进行优化,而不是按每个模块(编译单元)进行优化。#36937
  • SystemPreferences::CanPromptTouchID(macOS)现在支持 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.

如在 Farewell, 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.