Electron 36.0.0
Electron 36.0.0 已发布! 它包括升级到 Chromium 136、V8 13.6 和 Node 22.14.0。
Electron 团队很高兴发布了 Electron 36.0.0 ! 你可以通过 npm install electron@latest 或者从我们的发布网站下载它。 继续阅读此版本的详细信息。
如果您有任何反馈,请在 Bluesky 或 Mastodon 上与我们分享,或加入我们的 Discord 社区! Bug 和功能请求可以在 Electron 的问题跟踪器中报告。
重要变化
Writing Tools Support
在 Electron 36 中,您可以在您的上下文菜单中启用 macOS 系统级别的功能,例如写作工具(拼写和语法)、自动填充和服务菜单。 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)更新
- Chromium
136.0.7103.48 - Node
22.14.0 - V8
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
- Added
BrowserWindow.isSnapped()to indicate whether a given window has been arranged via Snap on Windows. #46226 - Added
WebContents.focusedFrameto get the focused frame. - Fixed
WebContents.openerto specify potentialnulltype. #45667 - Added
ffmpeg.dllto delay load configuration. #46173 (Also in 34, 35) - Added
nativeTheme.shouldUseDarkColorsForSystemIntegratedUIto distinguish system and app theme. #46598 (Also in 35) - Added
excludeUrlstowebRequestfilter and deprecated the use of empty arrays inurlsproperty. #44692 (Also in 35) - Added support for Autofill, Writing Tools and Services macOS level menu items in context menus via the new
frameoption inmenu.popup. #46350 - Added support for
system-context-menuon Linux. #46399 - Improved ASAR integrity checks on Windows. #46537
- Improved performance of
desktopCapturer.getSourceswhen not requesting thumbnails on macOS. #46251 (Also in 34, 35) - Removed 240 FPS limit when using shared texture OSR. #45669 (Also in 35)
重大更改
已弃用:NativeImage.getBitmap()
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 上的扩展方法和事件
session.loadExtension, session.removeExtension, session.getExtension,
session.getAllExtensions, and the events extension-loaded,
extension-unloaded, and extension-ready have all moved to the new
Extensions object
accessible via the session.extensions instance property.
已移除:session.clearStorageData(options) 中的 quoto 类型 syncable
When calling session.clearStorageData(options), the options.quota type
syncable is no longer supported because it has been
removed
from upstream Chromium.
Deprecated: quota property in session.clearStorageData(options)
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.
Behavior Changed: GTK 4 is the default when running on 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
Affected users can work around this by specifying the gtk-version command-line flag:
$ electron --gtk-version=3 # or --gtk-version=2
The same can be done with the app.commandLine.appendSwitch function.
Behavior Changed: app.commandLine
app.commandLine will convert uppercases switches and arguments to lowercase.
app.commandLine was only meant to handle Chromium switches (which aren't case-sensitive) and switches passed via app.commandLine will not be passed down to any of the child processes.
If you were using app.commandLine to parse app-specific command line arguments, you should do this via process.argv.
终止对 33.x.y 的支持
根据项目的支持政策,Electron 33.x.y 已经达到了支持的终点。 我们鼓励开发者将应用程序升级到更新的 Electron 版本。
| E36 (2025 年 4 月) | E37 (2025 年 6 月) | E38 (Aug'25) |
|---|---|---|
| 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 |
接下来
在短期内,您可以期待团队继续专注于跟上构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。
您可以在此处找到 Electron 的公开时间表。
有关这些和未来变化的更多信息可在计划的突破性变化页面找到。
