Electron 41
Electron 41 已发布!它包括对 Chromium 146.0.7680.65、V8 14.6 和 Node v24.14.0 的升级。
🌐 Electron 41 has been released! It includes upgrades to Chromium 146.0.7680.65, V8 14.6, and Node v24.14.0.
Electron 团队很高兴地宣布发布 Electron 41!你可以通过 npm install electron@latest 使用 npm 安装,或从我们的 发布网站 下载。继续阅读以了解有关此版本的详细信息。
🌐 The Electron team is excited to announce the release of Electron 41! 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.
在发布初始的 41.0.0 版本包之后,我们将一些高优先级的错误整合到了后续的补丁版本中。我们建议在升级到 Electron 41 时安装 41.0.2。
显著变化
🌐 Notable Changes
ASAR 完整性摘要以提升安全性
🌐 ASAR Integrity digest for improved security
自 Electron 41 起,macOS 的 Electron 应用现在可以嵌入其 ASAR 完整性 信息的摘要。这为使用 ASAR 完整性的应用增加了额外的篡改检测层,通过在应用启动时验证完整性信息本身。
🌐 As of Electron 41, macOS Electron apps can now embed a digest of their ASAR Integrity information. This adds an additional layer of tamper detection for apps that use ASAR Integrity by validating the integrity information itself at app launch.
要在你的应用中启用此功能,你可以在 @electron/asar v4.1.0 及以上版本运行以下命令:
🌐 To enable the feature for your app, you can run the following command with @electron/asar v4.1.0 and above:
asar integrity-digest on /path/to/YourApp.app
你之后必须重新签署你的应用。有关更多信息,请参阅 @electron/asar CLI 文档。
🌐 You must re-sign your app afterwards. For more information, see the @electron/asar CLI documentation.
Electron Forge 对此功能的支持计划在不久的将来推出 (electron/forge#4159)。
🌐 Support for this feature in Electron Forge is planned for the near future (electron/forge#4159).
改进的Wayland支持
🌐 Improved Wayland support
在 Wayland(Linux)上,无边框窗口现在具有投影和扩展的调整大小边界。要创建完全无边框且没有装饰的窗口,请在窗口构造函数中设置 hasShadow: false。#49885
🌐 On Wayland (Linux), frameless windows now have drop shadows and extended resize boundaries. To create fully frameless windows with no decorations, set hasShadow: false in the window constructor. #49885
Mitchell Cohen 写了一篇关于最近改进 Electron 对 Linux 上 Wayland 和客户端装饰支持的工作 博客文章。
已添加对 MSIX 自动更新的支持
🌐 Added support for MSIX auto-updating
Electron 团队最近根据 RFC #21 添加了 MSIX 自动更新支持。现在,你可以在更新服务器中同时发布 MSIX 和 Squirrel.Mac,基本上使用相同的 JSON 响应格式。更多信息请参阅 autoUpdater 文档。
🌐 The Electron team recently added MSIX auto-updater support according to RFC #21. You can now ship both MSIX and Squirrel.Mac in your update server essentially with the same JSON response format. See the autoUpdater documentation for more information.
这是由 #49586 在 Electron 41 中添加的,并且也已经回移植到 Electron 39.5.0 (#49585) 和 40.2.0 (#49587)。
🌐 This was added in Electron 41 by #49586 and has also been backported to Electron 39.5.0 (#49585) and 40.2.0 (#49587).
技术栈变更
🌐 Stack Changes
- Chromium
146.0.7680.65 - 节点
v24.14.0 - V8
14.6
Electron 41 将 Chromium 从 144.0.7559.60 升级到 146.0.7680.65,Node.js 从 v24.11.1 升级到 v24.14.0,以及 V8 从 14.4 升级到 14.6。
🌐 Electron 41 upgrades Chromium from 144.0.7559.60 to 146.0.7680.65, Node.js from v24.11.1 to v24.14.0, and V8 from 14.4 to 14.6.
新功能和改进
🌐 New Features and Improvements
- 为 macOS 应用添加了
--disable-geolocation命令行标志以禁用位置服务。#45934 - 为导入共享纹理添加了 NV12 支持。#48922 (也在 40)
- 添加了
webContents.getOrCreateDevToolsTargetId()。#50176 - 在
utilityProcessAPI 中添加了disclaim选项,以允许在 macOS 上进行 TCC 放弃。 #49693 (也在 39, 40) - 在 Windows 上的
Notification'closed'事件中添加了reason属性,以便开发者了解通知被关闭的原因。#50029 (也在 40) - 在
webContents.print()中添加了一个usePrinterDefaultPageSize选项,以允许使用打印机的默认纸张大小。 #49812 - 通过
webContents上的login事件添加了对 WebSocket 身份验证的支持。 #48512 (也在 39, 40) - 增加了对 Node.js
--experimental-transform-types标志的支持。#49882 (也在 39、40 中) - 已添加对
long-animation-frame脚本归属的支持(通过--enable-features=AlwaysLogLOAFURL)。#49773 (也在 39, 40 中) - 增加了通过
webPreferences.focusOnNavigation禁用在导航时WebContents自动聚焦的功能。 #49511 (也在 40) - 来自 Chromium DevTools 前端的无关错误现在在主进程中被静音。 #49292 (也在 40)
- 在
WasmTrapHandlersfuse 后为 WASM 启用了 V8 陷阱处理程序。 #49839 - Windows 通知的扩展操作支持,包括按钮、下拉选择菜单和回复。#49787 (也在 40)
重大变化
🌐 Breaking Changes
行为已更改:PDF 不再创建单独的 WebContents
🌐 Behavior Changed: PDFs no longer create a separate WebContents
以前,PDF 资源会创建一个单独的访客 WebContents 来进行渲染。现在,PDF 在同一个 WebContents 中渲染。如果你有检测 PDF 资源的代码,请使用 frame tree 而不是 WebContents。
🌐 Previously, PDF resources created a separate guest WebContents for rendering. Now, PDFs are rendered within the same WebContents instead. If you have code to detect PDF resources, use the frame tree instead of WebContents.
在底层,Chromium 启用 了一个将 PDF 改为使用进程外 iframe(OOPIFs)而不是 MimeHandlerViewGuest 扩展的功能。
🌐 Under the hood, Chromium enabled a feature that changes PDFs to use out-of-process iframes (OOPIFs) instead of the MimeHandlerViewGuest extension.
行为已更改:更新了 Cookie 'changed' 事件中的 Cookie 更改原因
🌐 Behavior Changed: Updated Cookie Change Cause in the Cookie 'changed' Event
我们已更新了 cookie 'changed' 事件 中的 cookie 变更原因。
当设置新 cookie 时,变更原因为 inserted。
当删除 cookie 时,变更原因保持为 explicit。
当设置的 cookie 与现有 cookie 完全相同(名称、域、路径和值相同,且没有实际更改)时,变更原因为 inserted-no-change-overwrite。
当设置的 cookie 值保持不变但更新了某些属性,例如过期属性时,变更原因为 inserted-no-value-change-overwrite。
🌐 We have updated the cookie change cause in the cookie 'changed' event.
When a new cookie is set, the change cause is inserted.
When a cookie is deleted, the change cause remains explicit.
When the cookie being set is identical to an existing one (same name, domain, path, and value, with no actual changes), the change cause is inserted-no-change-overwrite.
When the value of the cookie being set remains unchanged but some of its attributes are updated, such as the expiration attribute, the change cause will be inserted-no-value-change-overwrite.
已弃用:Linux 上对话框中的 showHiddenFiles
🌐 Deprecated: showHiddenFiles in Dialogs on Linux
此属性在 macOS 和 Windows 上仍将有效,但在未来的 Electron 版本中对 Linux 的支持将被移除。GTK 认为这是用户的选择,而不是应用的选择,并已移除了以编程方式执行此操作的 API。
🌐 This property will still be honored on macOS and Windows, but support on Linux will be removed in a future version of Electron. GTK intends for this to be a user choice rather than an app choice and has removed the API to do this programmatically.
38.x.y 版本停止支持
🌐 End of Support for 38.x.y
根据项目的支持政策,Electron 38.x.y 已达到支持终止。建议开发者和应用升级到更新版本的 Electron。请参阅 https://releases.electronjs.org/schedule 查看 Electron 支持版本的时间表。
🌐 Electron 38.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. See https://releases.electronjs.org/schedule to see the timeline for supported versions of Electron.
下一步计划
🌐 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.
