Electron 39.0.0
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 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。
🌐 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.
如果你有任何反馈,请通过 Bluesky 或 Mastodon 与我们分享,或者加入我们的社区 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
ASAR 完整性升级为稳定版
🌐 ASAR Integrity graduates to stable
一个长期存在的“实验性”功能——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.
请参阅 ASAR 完整性文档 以获取有关该功能的完整信息,包括功能的工作原理、如何在应用中使用它,以及如何在 Electron Forge 和 Electron Packager 中使用它。
🌐 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
技术栈变更
🌐 Stack Changes
- Chromium
142.0.7444.52 - 节点
22.20.0 - V8
14.2
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.
新功能和改进
🌐 New Features and Improvements
- 已添加
app.isHardwareAccelerationEnabled()。 #48680 - 在离屏渲染中添加了支持 scRGB HDR 色彩空间的
RGBAF16输出格式。#48504 - 添加了方法以实现更细粒度的无障碍支持管理。#48625
- 新增对
USBDevice.configurations的支持。#47459 - 新增了使用
systemPreferences.getAccentColor在 Linux 上获取系统强调色的功能。 #48628 - 允许在给定会话内持续保存文件系统 API 授权状态。#48326 (也见 37、38)
- 在非上下文隔离的预加载中支持动态 ESM 导入。#48488 (也见 37, 38)
- 将 ASAR 完整性 功能标记为稳定。该功能之前是实验性的。 #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'),
},
};
});
行为已更改:要使用 desktopCapturer,应将 NSAudioCaptureUsageDescription 包含在你的应用的 Info.plist 文件中(🍏 macOS ≥14.2)
🌐 Behavior Changed: NSAudioCaptureUsageDescription should be included in your app's Info.plist file to use desktopCapturer (🍏 macOS ≥14.2)
由于一次 Chromium 更新 默认启用了苹果较新的 CoreAudio Tap API,现在你必须在你的 Info.plist 中定义 NSAudioCaptureUsageDescription 才能使用 desktopCapturer。
🌐 Due to a Chromium update which enables Apple's newer CoreAudio Tap API by default, you now must have NSAudioCaptureUsageDescription defined in your Info.plist to use desktopCapturer.
如果缺少新权限,Electron 的 desktopCapturer 将创建一个无效的音频流。然而,不会出现任何错误或警告。这在一定程度上是 Chromium 的副作用,因为如果新系统失败,Chromium 不会回退到旧的 Screen & System Audio Recording 权限系统。
🌐 Electron's desktopCapturer will create a dead audio stream if the new permission is absent. However, no errors or warnings will occur. This is partially a side-effect of Chromium not falling back to the older Screen & System Audio Recording permissions system if the new system fails.
恢复先前行为:
🌐 To restore previous behavior:
//main.js (right beneath your require/import statments)
app.commandLine.appendSwitch(
'disable-features',
'MacCatapLoopbackAudioForScreenShare',
);
行为更改:共享纹理 OSR paint 事件数据结构
🌐 Behavior Changed: shared texture OSR paint event data structure
在使用共享纹理离屏渲染功能时,paint 事件现在会发出一个结构更清晰的对象。它将 sharedTextureHandle、planes、modifier 移动到统一的 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.y | 40.x.y | 41.x.y |
| 38.x.y | 39.x.y | 40.x.y |
| 37.x.y | 38.x.y | 39.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.