Skip to main content

Electron 39.0.0

· 8 min read

Electron 39.0.0 已发布!它包含对 Chromium 142.0.7444.52、V8 14.2 和 Node 22.20.0 的升级。

¥Electron 39.0.0 has been released! It includes upgrades to Chromium 142.0.7444.52, V8 14.2, and Node 22.20.0.


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

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

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

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

显著变化

¥Notable Changes

技术栈变更

¥Stack Changes

Electron 39 将 Chromium 从 140.0.7339.41 升级到 142.0.7444.52,Node.js 从 22.18.0 升级到 v22.20.0,V8 从 14.0 升级到 14.2

¥Electron 39 upgrades Chromium from 140.0.7339.41 to 142.0.7444.52, Node.js from 22.18.0 to v22.20.0, and V8 from 14.0 to 14.2.

ASAR 完整性升级为稳定版

¥ASAR Integrity graduates to stable

"experimental" 的一项长期功能 - ASAR 完整性 - 现已在 Electron 39 中稳定运行。启用此功能后,它会在运行时根据构建时哈希值验证你打包的 app.asar 文件,以检测任何篡改。如果不存在哈希值或者哈希值不匹配,则应用将强制终止。

¥A long-standing "experimental" feature -- ASAR integrity -- is now stable in Electron 39. When you enable this feature, it validates your packaged app.asar at runtime against a build-time hash to detect any tampering. If no hash is present or if there is a mismatch in the hashes, the app will forcefully terminate.

有关此功能的工作原理、如何在应用中使用它以及如何在 Electron Forge 和 Electron Packager 中使用它的完整信息,请参阅 ASAR 完整性文档 文档。

¥See the ASAR integrity documentation for full information on how on the feature works, on how to use it in your application, and how to use it in Electron Forge and Electron Packager.

相关消息:Electron Packager v19​​ 现在默认启用 ASAR。#1841

¥In related news, Electron Packager v19 now enables ASAR by default. #1841

新功能和改进

¥New Features and Improvements

  • 添加了 app.isHardwareAccelerationEnabled()#48680

    ¥Added app.isHardwareAccelerationEnabled(). #48680

  • 已为离屏渲染添加 scRGB HDR 色彩空间支持的 RGBAF16 输出格式。#48504

    ¥Added RGBAF16 output format with scRGB HDR color space support to Offscreen Rendering. #48504

  • 已添加用于更精细地管理辅助功能支持的方法。#48625

    ¥Added methods to enable more granular accessibility support management. #48625

  • 添加了对 USBDevice.configurations 的支持。#47459

    ¥Added support for USBDevice.configurations. #47459

  • 已添加使用 systemPreferences.getAccentColor 在 Linux 上检索系统强调色的功能。#48628

    ¥Added the ability to retrieve the system accent color on Linux using systemPreferences.getAccentColor. #48628

  • 允许在给定会话中持久化文件系统 API 授权状态。#48326 3738 中也支持)

    ¥Allowed for persisting File System API grant status within a given session. #48326 (Also in 37, 38)

  • 支持在非上下文隔离的预加载中使用动态 ESM 导入。#48488 3738 中也支持)

    ¥Support dynamic ESM imports in non-context isolated preloads. #48488 (Also in 37, 38)

  • 已将 ASAR 完整性 功能标记为稳定版。它之前处于实验阶段。#48434

    ¥Marked the ASAR integrity feature as stable. It had previously been experimental. #48434

重大变化

¥Breaking Changes

已弃用:--host-rules 命令行开关

¥Deprecated: --host-rules command line switch

Chromium 正在弃用 --host-rules 开关。

¥Chromium is deprecating the --host-rules switch.

你应该改用 --host-resolver-rules

¥You should use --host-resolver-rules instead.

行为改变:window.open 弹出窗口始终可调整大小

¥Behavior Changed: window.open popups are always resizable

根据当前的 WHATWG 规范window.open API 现在始终会创建一个可调整大小的弹出窗口。

¥Per current WHATWG spec, the window.open API will now always create a resizable popup window.

恢复先前行为:

¥To restore previous behavior:

webContents.setWindowOpenHandler((details) => {
return {
action: 'allow',
overrideBrowserWindowOptions: {
resizable: details.features.includes('resizable=yes'),
},
};
});

行为改变:共享纹理 OSR paint 事件数据结构

¥Behavior Changed: shared texture OSR paint event data structure

使用共享纹理离屏渲染功能时,paint 事件现在会发出结构更清晰的对象。它将 sharedTextureHandleplanesmodifier 合并为一个统一的 handle 属性。详细信息请参见 OffscreenSharedTexture 文档

¥When using the shared texture offscreen rendering feature, the paint event now emits a more structured object. It moves the sharedTextureHandle, planes, modifier into a unified handle property. See the OffscreenSharedTexture documentation for more details.

停止支持 36.x.y 版本

¥End of Support for 36.x.y

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

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

E39 (2025 年 10 月)E40 (2026 年 1 月)E41 (2026 年 2 月)
39.x.y40.x.y41.x.y
38.x.y39.x.y40.x.y
37.x.y38.x.y39.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.