Electron 43
Electron 43 已发布!它包括对 Chromium 150.0.7871.46、V8 15.0 和 Node v24.17.0 的升级。
🌐 Electron 43 has been released! It includes upgrades to Chromium 150.0.7871.46, V8 15.0, and Node v24.17.0.
Electron 团队很高兴地宣布发布 Electron 43!你可以通过 npm install electron@latest 使用 npm 安装,或从我们的 发布网站 下载。继续阅读以了解有关此版本的详细信息。
🌐 The Electron team is excited to announce the release of Electron 43! 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
改进的应用启动性能
🌐 Improved app startup performance
Electron 43 对应用启动性能进行了多项改进。主进程现在从嵌入的 Node.js 启动快照启动,框架打包包和预加载脚本被缓存为已编译的 V8 字节码,并且沙盒渲染器的启动数据提前推送,而不是通过阻塞的 IPC 获取。作为额外改进,预加载堆栈跟踪现在显示正确的文件路径和行号。#51792
🌐 Electron 43 ships several improvements to app startup performance. The main process now boots from an embedded Node.js startup snapshot, framework bundles and preload scripts are cached as compiled V8 bytecode, and sandboxed renderer startup data is pushed ahead of navigation instead of fetched via blocking IPC. As a bonus, preload stack traces now show the correct file path and line number. #51792
Linux 上的无框窗口现在默认具有圆角
🌐 Frameless windows on Linux now have rounded corners by default
在 Linux 上,无边框窗口现在默认具有圆角,这与 macOS 和 Windows 上的行为一致。通过在窗口上设置 roundedCorners: false,可以在所有平台上禁用圆角。#52111
🌐 On Linux, frameless windows now have rounded corners by default, matching the behavior on macOS and Windows. Rounded corners can be disabled on all platforms by setting roundedCorners: false on the window. #52111
文件下载现在默认在下载文件夹中打开
🌐 File downloads now open in the Downloads folder by default
文件下载现在将默认打开在用户的“下载”文件夹中(如果不存在“下载”文件夹,则在主目录中)。#49868
🌐 File downloads will now open by default in the user's Downloads folder (or the Home directory if Downloads doesn't exist). #49868
新的 macOS 通知管理 API
🌐 New macOS Notification management APIs
Electron 43 在 macOS 上新增了 Notification.remove()、Notification.removeAll() 和 Notification.removeGroup() 静态方法,使开发者能够更精细地控制已发送的通知。结合现有的 Notification.getHistory() API,你现在可以完全管理通知中心中通知的生命周期。#51690
🌐 Electron 43 adds Notification.remove(), Notification.removeAll(), and Notification.removeGroup() static methods on macOS, giving developers finer control over delivered notifications. Combined with the existing Notification.getHistory() API, you can now fully manage the lifecycle of notifications in Notification Center. #51690
技术栈变更
🌐 Stack Changes
- Chromium
150.0.7871.46 - 节点
v24.17.0 - V8
15.0
Electron 43 将 Chromium 从 148.0.7778.96 升级到 150.0.7871.46,Node.js 从 v24.15.0 升级到 v24.17.0,并将 V8 从 14.8 升级到 15.0。
🌐 Electron 43 upgrades Chromium from 148.0.7778.96 to 150.0.7871.46, Node.js from v24.15.0 to v24.17.0, and V8 from 14.8 to 15.0.
新功能和改进
🌐 New Features and Improvements
- 向
WebContents添加了 Clone 方法。 #49959 - 在渲染器内存不足时的崩溃报告中添加了 JS 堆栈跟踪。#50043
- 为
app.getApplicationInfoForProtocol()添加了 Linux 支持。 #51297 - 为 macOS 添加了
Notification.remove()、Notification.removeAll()和Notification.removeGroup()静态方法。 #51690 - 为 macOS 添加了
Notification.getHistory(),允许开发者恢复通知中心中仍存在的所有已发送通知。#50325 - 已向
MenuItem构造函数选项和属性添加accessibilityLabel属性,用于定义屏幕阅读器友好的标签。#50240 - 已向
protocol.registerSchemesAsPrivileged()添加allowExtensions权限,以在自定义协议上启用 Chrome 扩展程序。#49951 - 添加了
app.configureWebAuthn()以在 macOS 上启用 WebAuthn 的 Touch ID 平台认证器,以及用于在多个可发现凭据之间进行选择的select-webauthn-account会话事件。 #51255 - 添加了
globalShortcut.setSuspended()和globalShortcut.isSuspended()方法用于临时暂停和恢复全局快捷键处理。 #50425 - 在 macOS 上的
Notification构造函数中添加了id和groupId选项。id允许为通知使用自定义标识符,而groupId在通知中心中将通知进行视觉分组。#50097 - 为 Windows 通知添加了
id、groupId和groupTitle支持。#50328 - 在 macOS 上添加了
nativeTheme.shouldDifferentiateWithoutColor。 #49912 - 为专业用途添加了
nv12OSR 像素格式支持。 #49799 - 添加了
view.setBackgroundBlur()。#51076 - 添加了
webContents.copyVideoFrameAt(x, y)和webContents.saveVideoFrameAs(x, y)方法。 #48149 - 为实用程序进程的 net 模块请求添加了会话支持。 #51279
- 通过
contentTracing.enableHeapProfiling()添加了对堆分析的支持。 #50826 - 添加了使用 nv16 像素格式导入共享纹理的支持。 #50728
- 在 Windows 的通知中添加了对
urgency选项的支持。 #50225 - 添加了在 yarn 安装期间使用代理的支持。#50322
- 允许将
--experimental-inspector-network-resourceNode.js 标志通过 Electron 传递。 #49689 - 在 macOS 构建中启用 ThinLTO。#51819
- 在发布版本中为 V8 内置函数启用了基于配置文件的优化,从而提升了 JavaScript 内置函数的性能(Array、String、RegExp 等)。#50416
- 改进的应用启动性能 —— 主进程现在从嵌入的 Node.js 启动快照启动,框架包和预加载脚本被缓存为已编译的 V8 字节码,并且沙箱渲染器启动数据会在导航前提前推送,而不是通过阻塞 IPC 获取。#51792
- 通过为主 Electron 二进制文件启用 ThinLTO 链接时优化,提高了 Linux 和 Windows 发布版的性能。#51820
- 在 Linux 上改进了
app.getApplicationNameForProtocol()的性能。 #51251 - 在 Linux 上改善了
app.isDefaultProtocolClient()和app.setAsDefaultProtocolClient()的性能。#51316 webRequest头文件转换以及其他多个 gin 转换器热点路径的性能改进。 #51608- 改进了本地事件触发、IPC 调度和选项字典解析的性能。#51615
重大变化
🌐 Breaking Changes
行为已更改:文件下载现在会在下载文件夹中打开
🌐 Behavior Changed: File downloads now open in the Downloads folder
文件下载现在将默认在用户的下载文件夹中打开(如果下载文件夹不存在,则在主目录中)。#49868
🌐 File downloads will now open by default in the user's Downloads folder (or the Home directory if the Downloads folder doesn't exist). #49868
行为已更改:nativeImage 像素值归一化为 SRGB
🌐 Behavior Changed: nativeImage pixel values are normalized to SRGB
如果将带有色彩配置文件的图片传递给 nativeImage,其像素值现在将被归一化为 SRGB。这确保了在应用色彩空间后,两个在视觉上相同的图片在转换为 nativeImage 时会获得相似的像素值。 #51565
🌐 If a nativeImage was passed an image with a color profile, its pixel values will now be normalized to SRGB. This ensures that two visually identical images after color space application will receive similar pixel values when converted to a nativeImage. #51565
行为已改变:Linux 上无边框窗口默认有圆角
🌐 Behavior Changed: Frameless windows have rounded corners on Linux by default
在 Linux 上,无边框窗口现在默认具有圆角,这与 macOS 和 Windows 上的行为一致。通过在窗口上设置 roundedCorners: false,可以在所有平台上禁用圆角。#52111
🌐 On Linux, frameless windows now have rounded corners by default, matching the behavior on macOS and Windows. Rounded corners can be disabled on all platforms by setting roundedCorners: false on the window. #52111
行为已更改:WCO 在 Linux 上遵守原生标题栏布局
🌐 Behavior Changed: WCO respects the native title bar layout on Linux
带有窗口控件覆盖(WCO)的无框窗口现在在 Linux 上采用本地标题栏布局和用户设置。例如,在从右到左(RTL)系统上,控件会出现在框架的左侧,而在 GNOME 上默认情况下只会显示关闭按钮。根据用户的桌面环境和配置,按钮可以出现在框架的左侧或右侧(或两者)。为了考虑所有可能性,请使用 CSS 变量 env(titlebar-area-x, 0px) 和 env(titlebar-area-width, 100%) 将应用的标题栏内容约束在安全区域内。#52018
🌐 Frameless windows with Window Controls Overlay (WCO) now adopt the native title bar layout and user settings on Linux. For example, controls will appear on the left side of the frame on RTL systems, and only the close button will be visible by default on GNOME. Depending on the user's desktop environment and configuration, buttons can appear on the left or right side of the frame (or both). To account for all possibilities, use the CSS variables env(titlebar-area-x, 0px) and env(titlebar-area-width, 100%) to constrain your app's title bar content to a safe area. #52018
行为已更改:chrome.scripting CSS 注入匹配更多回退框架
🌐 Behavior Changed: chrome.scripting CSS injection matches more fallback frames
使用 chrome.scripting.insertCSS() 或 chrome.scripting.removeCSS() 的扩展现在在 Electron 无法直接匹配框架的 URL 时(例如 about:blank 或 data: 框架)会遵循 Chrome 的行为。如果扩展有权访问创建该框架的页面,现在也可以向这些后备框架插入或移除 CSS。依赖 Electron 跳过这些框架的应用或扩展应缩小其注入目标、框架 ID 或匹配模式。 #51376
🌐 Extensions using chrome.scripting.insertCSS() or chrome.scripting.removeCSS()
now follow Chrome's behavior when Electron cannot match a frame's URL directly,
such as with about:blank or data: frames. If the extension has access to the
page that created the frame, CSS may now be inserted into or removed from those
fallback frames as well.
Apps or extensions that relied on Electron skipping those frames should narrow their
injection target, frame IDs, or match patterns. #51376
已从 Linux 上的 dialog API 中移除:showHiddenFiles
🌐 Removed: showHiddenFiles from dialog API on Linux
showHiddenFiles 支持已从 Linux 上的 dialog API 中移除。#51880
40.x.y 版本停止支持
🌐 End of Support for 40.x.y
根据项目的支持政策,Electron 40.x.y 已达到支持终止。建议开发者和应用升级到更新版本的 Electron。请参阅 https://releases.electronjs.org/schedule 查看 Electron 支持版本的时间表。
🌐 Electron 40.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.
对32位平台的支持即将结束
🌐 Support for 32-bit platforms ending
Electron 43.x.y 将是 Electron 最后一个为 32 位平台提供预构建二进制文件的版本系列:Windows x86(win32-ia32)和 Linux ARM(linux-armv7l)。一旦 v43 系列在 2027 年 1 月达到生命周期终止,这些 32 位平台将不再受支持。
🌐 Electron 43.x.y will be the last version series of Electron to ship with prebuilt binaries for 32-bit platforms: Windows x86 (win32-ia32) and Linux ARM (linux-armv7l). Once the v43 series reaches end of life in January 2027, these 32-bit platforms will no longer be supported.
下一步计划
🌐 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.
