Skip to main content

Electron 38.0.0

· 9 min read

Electron 38.0.0 已发布!它包含对 Chromium 140.0.7339.41、V8 14.0 和 Node 22.16.0 的升级。

¥Electron 38.0.0 has been released! It includes upgrades to Chromium 140.0.7339.41, V8 14.0, and Node 22.16.0.


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

¥The Electron team is excited to announce the release of Electron 38.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 38 将 Chromium 从 138.0.7204.35 升级到 140.0.7339.41,将 Node 从 22.16.0 升级到 22.18.0,并将 V8 从 13.8 升级到 14.0

¥Electron 38 upgrades Chromium from 138.0.7204.35 to 140.0.7339.41, Node from 22.16.0 to 22.18.0, and V8 from 13.8 to 14.0.

新功能和改进

¥New Features and Improvements

  • 添加了对自定义系统强调色和高亮活动窗口边框的支持。#4728537 中也存在)

    ¥Added support for customizing system accent color and highlighting of active window border. #47285 (Also in 37)

  • 在 macOS 的 process.getSystemMemoryInfo() 中添加了 fileBackedpurgeable 字段。#4814637 中也包含)

    ¥Added fileBacked and purgeable fields to process.getSystemMemoryInfo() for macOS. #48146 (Also in 37)

  • 添加了 tray.{get|set}AutosaveName 字段,使 macOS 托盘图标能够在启动过程中保持位置不变。#4807737 中也包含)

    ¥Added tray.{get|set}AutosaveName to enable macOS tray icons to maintain position across launches. #48077 (Also in 37)

  • 添加了 webFrameMain.fromFrameToken(processId, frameToken) 字段,以便从其框架令牌中获取 WebFrameMain 实例。#47942

    ¥Added webFrameMain.fromFrameToken(processId, frameToken) to get a WebFrameMain instance from its frame token. #47942

  • 在 Windows 和 macOS 上添加了对 app.getRecentDocuments() 的支持。#4792437 中也包含)

    ¥Added support for app.getRecentDocuments() on Windows and macOS. #47924 (Also in 37)

  • 内部已切换为使用 DIR_ASSETS 而非 DIR_MODULE/DIR_EXE 来定位资源,并添加了 "assets" 作为可通过 app.getPath 查询的键。#4795037 中也包含)

    ¥Internally switched to using DIR_ASSETS instead of DIR_MODULE/DIR_EXE to locate assets and resources, and added "assets" as a key that can be queried via app.getPath. #47950 (Also in 37)

  • 修复了 dialog.showMessageDialog 传递时错误地将窗口居中显示为显示器而不是父窗口的问题。#48215

    ¥Fixed an issue where dialog.showMessageDialog showed a window incorrectly centered to monitor instead of parent window when passed. #48215

  • 修复了 macOS 用户无法与通过 loadURL 加载的网页交互的问题。#47575

    ¥Fixed an issue where users on macOS were unable to interact with a webpage loaded via loadURL. #47575

重大变化

¥Breaking Changes

删除:macOS 11 支持

¥Removed: macOS 11 support

Chromium 不再支持 macOS 11 (Big Sur)。

¥macOS 11 (Big Sur) is no longer supported by Chromium.

旧版本的 Electron 将继续在 Big Sur 上运行,但需要 macOS 12 (Monterey) 或更高版本才能运行 Electron v38.0.0 及更高版本。

¥Older versions of Electron will continue to run on Big Sur, but macOS 12 (Monterey) or later will be required to run Electron v38.0.0 and higher.

删除:ELECTRON_OZONE_PLATFORM_HINT 环境变量

¥Removed: ELECTRON_OZONE_PLATFORM_HINT environment variable

--ozone-plaftform 标志 更改为 auto 的默认值。

¥The default value of the --ozone-plaftform flag changed to auto.

如果使用 Wayland,你应该改用 XDG_SESSION_TYPE=wayland 环境变量。

¥You should use the XDG_SESSION_TYPE=wayland environment variable instead to use Wayland.

删除:plugin-crashed 事件

¥Removed: plugin-crashed event

plugin-crashed 事件已从 webContents 中移除。

¥The plugin-crashed event has been removed from webContents.

已弃用:webFrame.routingId 属性

¥Deprecated: webFrame.routingId property

routingId 属性将从 webFrame 对象中移除。

¥The routingId property will be removed from webFrame objects.

你应该改用 webFrame.frameToken

¥You should use webFrame.frameToken instead.

已弃用:webFrame.findFrameByRoutingId(routingId)

¥Deprecated: webFrame.findFrameByRoutingId(routingId)

webFrame.findFrameByRoutingId(routingId) 函数将被移除。

¥The webFrame.findFrameByRoutingId(routingId) function will be removed.

你应该改用 webFrame.findFrameByToken(frameToken)

¥You should use webFrame.findFrameByToken(frameToken) instead.

Google Summer of Code 总结

¥Google Summer of Code Concludes

我们的两位 Google Summer of Code 贡献者刚刚完成了他们的暑期项目!

¥Our two Google Summer of Code contributors have just completed their summer projects!

  • @nilayarya 在 Electron 核心中构建了一个新的 保存/恢复窗口状态 API。新的 API 将提供一种内置的标准化方法来处理窗口状态的持久性。请参阅 Nilay 的原始 RFC(electron/rfcs#16)。

    ¥@nilayarya crafted a new Save/Restore Window State API in Electron core. The new APIs will provide a built-in, standardized way to handle window state persistence. See Nilay's original RFC at electron/rfcs#16.

  • @hitarth-gg 投入了大量精力,使用 Chrome Manifest V3 API 对长期闲置的 Devtron 扩展进行了现代化改造。该项目为开发者提供了工具,用于调试 IPC 通信、跟踪事件监听器以及可视化 Electron 应用中的模块依赖。

    ¥@hitarth-gg put a lot of hard work into modernizing the long-dormant Devtron extension using Chrome Manifest V3 APIs. This project provides tooling for developers to debug IPC communication, track event listeners, and visualize module dependencies in their Electron applications.

敬请期待更详细的博客文章,其中概述了他们的项目和成果。

¥Stay tuned for a more detailed blog post outlining their projects and the outcomes.

35.x.y 版本支持终止

¥End of Support for 35.x.y

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

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

E38 (2025 年 9 月)E39 (2025 年 10 月)E40 (2026 年 1 月)
38.x.y39.x.y40.x.y
37.x.y38.x.y39.x.y
36.x.y37.x.y38.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.