Skip to main content

Electron 38.0.0

· 7 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 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。

🌐 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.

技术栈变更

🌐 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

  • 新增对自定义系统强调色和高亮显示活动窗口边框的支持。#47285(也在 37 中)
  • 在 macOS 的 process.getSystemMemoryInfo() 中添加了 fileBackedpurgeable 字段。#48146(也在 37 中)
  • 在 macOS 上为 guid Tray 构造选项添加了支持,以允许托盘图标在多次启动时保持位置。 #48077(也在 37 中)
  • 添加了 webFrameMain.fromFrameToken(processId, frameToken) 来通过其框架令牌获取 WebFrameMain 实例。 #47942
  • 在 Windows 和 macOS 上添加了对 app.getRecentDocuments() 的支持。#47924(也在 37 中)
  • 内部已切换为使用 DIR_ASSETS 而不是 DIR_MODULE/DIR_EXE 来定位资源和资源,并添加了“assets”作为可以通过 app.getPath 查询的键。#47950(也在 37 中)
  • 修复了一个问题,即当传入 dialog.showMessageDialog 时,窗口显示位置错误,居中到显示器而不是父窗口。#48215
  • 修复了 macOS 用户无法与通过 loadURL 加载的网页进行交互的问题。#47575

重大变化

🌐 Breaking Changes

已移除:macOS 11 支持

🌐 Removed: macOS 11 support

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

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

较旧版本的 Electron 仍可在 Big Sur 上运行,但运行 Electron v38.0.0 及更高版本需要 macOS 12(Monterey)或更高版本。

🌐 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-platform 标志的默认值已 更改为 auto

🌐 The default value of the --ozone-platform flag changed to auto.

在 Linux 的 Wayland 会话中启动时,Electron 现在默认以原生 Wayland 应用的方式运行。一些功能和 API 在 Wayland 与 X11 中的表现不同。你可以通过添加标志 --ozone-platform=x11 来强制 Electron 以 X11 兼容模式(Xwayland)运行,就像旧版本那样。

🌐 Electron now runs as a native Wayland app by default when launched in a Wayland session on Linux. Some features and APIs behave differently in Wayland and X11. You can force Electron to run in X11 compatibility mode (Xwayland), like it did in older versions, by appending the flag --ozone-platform=x11.

已移除:plugin-crashed 事件

🌐 Removed: plugin-crashed event

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

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

已弃用:webFrame.routingId 属性

🌐 Deprecated: webFrame.routingId property

webFrame 对象将不再包含 routingId 属性。

🌐 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
  • @hitarth-gg 在使用 Chrome Manifest V3 API 现代化长期未活跃的 Devtron 扩展上投入了大量工作。该项目为开发者提供了工具,用于调试 IPC 通信、跟踪事件监听器以及可视化他们 Electron 应用中的模块依赖。

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

🌐 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.