Electron 33.0.0
Electron 33.0.0 已发布!此更新包含对 Chromium 130.0.6723.44、V8 13.0 和 Node 20.18.0 的升级。
¥Electron 33.0.0 has been released! It includes upgrades to Chromium 130.0.6723.44, V8 13.0, and Node 20.18.0.
Electron 团队很高兴地宣布 Electron 33.0.0 正式发布!你可以通过 npm install electron@latest
使用 npm 安装它,也可以从我们的 发布网站。继续阅读以了解有关此版本的详细信息。
¥The Electron team is excited to announce the release of Electron 33.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.
如果你有任何反馈,请在 Twitter 或 Mastodon 上与我们分享,或加入我们的社区 Discord!可以在 Electron 的 问题跟踪器 中报告错误和功能请求。
¥If you have any feedback, please share it with us on Twitter or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.
显著变化
¥Notable Changes
亮点
¥Highlights
-
添加了处理程序
app.setClientCertRequestPasswordHandler(handler)
,以便在需要 PIN 码时帮助解锁加密设备。#41205¥Added a handler,
app.setClientCertRequestPasswordHandler(handler)
, to help unlock cryptographic devices when a PIN is needed. #41205 -
扩展
navigationHistory
API,新增 2 个函数,以便更好地管理历史记录。#42014¥Extended
navigationHistory
API with 2 new functions for better history management. #42014 -
改进了原生主题透明度检查。#42862
¥Improved native theme transparency checking. #42862
技术栈变更
¥Stack Changes
-
Chromium
130.0.6723.44
-
Node
20.18.0
-
V8
13.0
Electron 33 将 Chromium 从 128.0.6613.36
升级到 130.0.6723.44
,将 Node 从 20.16.0
升级到 20.18.0
,将 V8 从 12.8
升级到 13.0
。
¥Electron 33 upgrades Chromium from 128.0.6613.36
to 130.0.6723.44
, Node from 20.16.0
to 20.18.0
, and V8 from 12.8
to 13.0
.
新功能
¥New Features
-
添加了处理程序
app.setClientCertRequestPasswordHandler(handler)
,以便在需要 PIN 码时帮助解锁加密设备。#41205¥Added a handler,
app.setClientCertRequestPasswordHandler(handler)
, to help unlock cryptographic devices when a PIN is needed. #41205 -
在实用程序进程中添加了错误事件,以支持 V8 致命错误的诊断报告。#43997
¥Added error event in utility process to support diagnostic reports on V8 fatal errors. #43997
-
添加了
View.setBorderRadius(radius)
,用于自定义视图的边框半径,并兼容WebContentsView
。#42320¥Added
View.setBorderRadius(radius)
for customizing the border radius of views—with compatibility forWebContentsView
. #42320 -
扩展
navigationHistory
API,新增 2 个函数,以便更好地管理历史记录。#42014¥Extended
navigationHistory
API with 2 new functions for better history management. #42014
重大变化
¥Breaking Changes
删除:macOS 10.15 支持
¥Removed: macOS 10.15 support
Chromium 不再支持 macOS 10.15 (Catalina)。
¥macOS 10.15 (Catalina) is no longer supported by Chromium.
旧版本的 Electron 将继续在 Catalina 上运行,但需要 macOS 11(Big Sur)或更高版本才能运行 Electron v33.0.0 及更高版本。
¥Older versions of Electron will continue to run on Catalina, but macOS 11 (Big Sur) or later will be required to run Electron v33.0.0 and higher.
行为改变:原生模块现在需要 C++20
¥Behavior Changed: Native modules now require C++20
由于上游所做的更改,V8 和 Node.js 现在都需要 C++20 作为最低版本。使用原生节点模块的开发者应该使用 --std=c++20
而不是 --std=c++17
构建他们的模块。使用 gcc9 或更低版本的图片可能需要更新到 gcc10 才能编译。详细信息请参见 #43555。
¥Due to changes made upstream, both V8 and Node.js now require C++20 as a minimum version. Developers using native node modules should build their modules with --std=c++20
rather than --std=c++17
. Images using gcc9 or lower may need to update to gcc10 in order to compile. See #43555 for more details.
行为改变:Windows 上的自定义协议 URL 处理
¥Behavior Changed: custom protocol URL handling on Windows
由于 Chromium 中进行了更改以支持 非特殊方案 URL,使用 Windows 文件路径的自定义协议 URL 将不再与已弃用的 protocol.registerFileProtocol
和 BrowserWindow.loadURL
、WebContents.loadURL
和 <webview>.loadURL
上的 baseURLForDataURL
属性正确配合使用。protocol.handle
也不适用于这些类型的 URL,但这不是变化,因为它一直以这种方式工作。
¥Due to changes made in Chromium to support Non-Special Scheme URLs, custom protocol URLs that use Windows file paths will no longer work correctly with the deprecated protocol.registerFileProtocol
and the baseURLForDataURL
property on BrowserWindow.loadURL
, WebContents.loadURL
, and <webview>.loadURL
. protocol.handle
will also not work with these types of URLs but this is not a change since it has always worked that way.
// No longer works
protocol.registerFileProtocol('other', () => {
callback({ filePath: '/path/to/my/file' });
});
const mainWindow = new BrowserWindow();
mainWindow.loadURL(
'data:text/html,<script src="loaded-from-dataurl.js"></script>',
{ baseURLForDataURL: 'other://C:\\myapp' },
);
mainWindow.loadURL('other://C:\\myapp\\index.html');
// Replace with
const path = require('node:path');
const nodeUrl = require('node:url');
protocol.handle(other, (req) => {
const srcPath = 'C:\\myapp\\';
const reqURL = new URL(req.url);
return net.fetch(
nodeUrl.pathToFileURL(path.join(srcPath, reqURL.pathname)).toString(),
);
});
mainWindow.loadURL(
'data:text/html,<script src="loaded-from-dataurl.js"></script>',
{ baseURLForDataURL: 'other://' },
);
mainWindow.loadURL('other://index.html');
行为改变:webContents
属性于 login
于 app
¥Behavior Changed: webContents
property on login
on app
当使用 respondToAuthRequestsFromMainProcess
选项创建的 实用进程 请求触发事件时,来自 app
的 login
事件中的 webContents
属性将为 null
。
¥The webContents
property in the login
event from app
will be null
when the event is triggered for requests from the utility process
created with respondToAuthRequestsFromMainProcess
option.
已弃用:BrowserWindowConstructorOption.type
中的 textured
选项
¥Deprecated: textured
option in BrowserWindowConstructorOption.type
BrowserWindowConstructorOptions
中 type
的 textured
选项已被弃用,没有替代品。此选项依赖于 macOS 上的 NSWindowStyleMaskTexturedBackground
样式掩码,该掩码已被弃用且没有其他选择。
¥The textured
option of type
in BrowserWindowConstructorOptions
has been deprecated with no replacement. This option relied on the NSWindowStyleMaskTexturedBackground
style mask on macOS, which has been deprecated with no alternative.
已弃用:systemPreferences.accessibilityDisplayShouldReduceTransparency
¥Deprecated: systemPreferences.accessibilityDisplayShouldReduceTransparency
systemPreferences.accessibilityDisplayShouldReduceTransparency
属性现已弃用,取而代之的是新的 nativeTheme.prefersReducedTransparency
,它提供相同的信息并可跨平台工作。
¥The systemPreferences.accessibilityDisplayShouldReduceTransparency
property is now deprecated in favor of the new nativeTheme.prefersReducedTransparency
, which provides identical information and works cross-platform.
// Deprecated
const shouldReduceTransparency =
systemPreferences.accessibilityDisplayShouldReduceTransparency;
// Replace with:
const prefersReducedTransparency = nativeTheme.prefersReducedTransparency;
30.x.y
Electron 30.x.y 已根据项目的 支持政策 终止支持。建议开发者和应用升级到较新版本的 Electron。
¥Electron 30.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.
E33 (2024 年 10 月) | E34 (2025 年 1 月) | E35 (2025 年 4 月) |
---|---|---|
33.x.y | 34.x.y | 35.x.y |
32.x.y | 33.x.y | 34.x.y |
31.x.y | 32.x.y | 33.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.