Electron 36.0.0
Electron 36.0.0 已发布!它包括对 Chromium 136、V8 13.6 和 Node 22.14.0 的升级。
🌐 Electron 36.0.0 has been released! It includes upgrades to Chromium 136, V8 13.6, and Node 22.14.0.
Electron 团队很高兴地宣布发布 Electron 36.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。
🌐 The Electron team is excited to announce the release of Electron 36.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
写作工具支持
🌐 Writing Tools Support
在 Electron 36 中,你可以在上下文菜单中启用 macOS 系统级功能,例如写作工具(拼写和语法检查)、自动填充以及服务菜单项。要实现此功能,请将一个 WebFrameMain 实例传入 menu.popup() 的 frame 参数中。
🌐 In Electron 36, you can enable macOS system-level features like Writing Tools (spelling and grammar), Autofill, and Services menu items in your context menus. To do so, pass a WebFrameMain instance into the frame parameter for menu.popup().
import { BrowserWindow, Menu, WebFrameMain } from 'electron';
const currentWindow = BrowserWindow.getFocusedWindow();
const focusedFrame = currentWindow.webContents.focusedFrame;
const menu = Menu.buildFromTemplate([{ label: 'Copy', role: 'copy' }]);
menu.popup({
window: currentWindow,
frame: focusedFrame,
});
技术栈变更
🌐 Stack Changes
- Chromium
136.0.7103.48 - 节点
22.14.0 - V8
13.6
Electron 36 将 Chromium 从 134.0.6998.23 升级到 136.0.7103.48,并将 V8 从 13.5 升级到 13.6。
🌐 Electron 36 upgrades Chromium from 134.0.6998.23 to 136.0.7103.48, and V8 from 13.5 to 13.6.
新功能和改进
🌐 New Features and Improvements
- 添加了
BrowserWindow.isSnapped()以指示指定窗口是否已通过 Windows 的快捷排列功能进行排列。#46226 - 添加了
WebContents.focusedFrame来获取聚焦的框架。 - 修复了
WebContents.opener以指定潜在的null类型。 #45667 - 已将
ffmpeg.dll添加到延迟加载配置中。#46173(也在 34、35 中) - 添加了
nativeTheme.shouldUseDarkColorsForSystemIntegratedUI以区分系统和应用主题。 #46598(也在 35 中) - 已将
excludeUrls添加到webRequest过滤器,并弃用在urls属性中使用空数组。 #44692 (也在 35 中) - 通过
menu.popup中的新frame选项,在上下文菜单中添加了对自动填充、写作工具和服务 macOS 级菜单项的支持。#46350 - 在 Linux 上增加了对
system-context-menu的支持。 #46399 - 改进了 Windows 上的 ASAR 完整性检查。#46537
- 在 macOS 上不请求缩略图时,
desktopCapturer.getSources的性能有所提升。#46251(也在 34、35 中出现) - 在使用共享纹理 OSR 时移除了 240 FPS 限制。#45669(也在 35 中)
重大变化
🌐 Breaking Changes
已弃用:NativeImage.getBitmap()
🌐 Deprecated: NativeImage.getBitmap()
NativeImage.getBitmap() 函数现在已被弃用,并记录为 NativeImage.toBitmap() 的别名。两者函数都会返回新分配的位图副本,功能上是等效的。
🌐 The NativeImage.getBitmap() function is now deprecated and documented as an alias for NativeImage.toBitmap().
The two functions both return a newly-allocated copy of the bitmap and are functionally equivalent.
已弃用:session 的扩展方法和事件
🌐 Deprecated: Extension methods and events on session
session.loadExtension、session.removeExtension、session.getExtension、session.getAllExtensions 以及事件 extension-loaded、extension-unloaded 和 extension-ready 都已移至新的 Extensions 对象,可以通过 session.extensions 实例属性访问。
已移除:session.clearStorageData(options) 中的 quota 类型 syncable
🌐 Removed: quota type syncable in session.clearStorageData(options)
在调用 session.clearStorageData(options) 时,类型 options.quota 的 syncable 已不再受支持,因为它已从上游 Chromium 中被 移除。
🌐 When calling session.clearStorageData(options), the options.quota type
syncable is no longer supported because it has been
removed
from upstream Chromium.
已弃用:session.clearStorageData(options) 中的 quota 属性
🌐 Deprecated: quota property in session.clearStorageData(options)
调用 Session.clearStorageData(options) 时,options.quota 属性已被弃用。由于 syncable 类型已被移除,现在只剩下 'temporary' 类型,因此不需要再指定它。
🌐 When calling Session.clearStorageData(options), the options.quota
property is deprecated. Since the syncable type was removed, there
is only type left -- 'temporary' -- so specifying it is unnecessary.
行为更改:在 GNOME 上运行时,默认使用 GTK 4
🌐 Behavior Changed: GTK 4 is the default when running on GNOME
在一次上游更改之后,GTK 4 现在在 GNOME 上运行时成为默认选项。
🌐 After an upstream change, GTK 4 is now the default when running on GNOME.
在极少数情况下,这可能导致某些应用或配置出现如下消息的错误:
🌐 In rare cases, this may cause some applications or configurations to error with the following message:
Gtk-ERROR **: 11:30:38.382: GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported
受影响的用户可以通过指定 gtk-version 命令行标志来解决此问题:
🌐 Affected users can work around this by specifying the gtk-version command-line flag:
$ electron --gtk-version=3 # or --gtk-version=2
同样可以使用 app.commandLine.appendSwitch 函数来完成。
🌐 The same can be done with the app.commandLine.appendSwitch function.
行为已更改:app.commandLine
🌐 Behavior Changed: app.commandLine
app.commandLine 会将大写的开关和参数转换为小写。
app.commandLine 仅用于处理 Chromium 开关(不区分大小写),通过 app.commandLine 传递的开关不会传递给任何子进程。
如果你使用 app.commandLine 来解析应用特定的命令行参数,你应该通过 process.argv 来完成此操作。
🌐 If you were using app.commandLine to parse app-specific command line arguments, you should do this via process.argv.
33.x.y 停止支持
🌐 End of Support for 33.x.y
根据项目的支持政策,Electron 33.x.y 已达到支持结束。建议开发者和应用升级到更新版本的 Electron。
🌐 Electron 33.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.
| E36(2025年4月) | E37(2025年6月) | E38(2025年8月) |
|---|---|---|
| 36.x.y | 37.x.y | 38.x.y |
| 35.x.y | 36.x.y | 37.x.y |
| 34.x.y | 35.x.y | 36.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.