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 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。
🌐 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
- 添加了一个处理程序
app.setClientCertRequestPasswordHandler(handler),以在需要 PIN 时帮助解锁加密设备。#41205 - 扩展了
navigationHistoryAPI,增加了 2 个新功能以更好地管理历史记录。#42014 - 改进了原生主题透明度检查。 #42862
技术栈变更
🌐 Stack Changes
- Chromium
130.0.6723.44 - 节点
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 - 在实用程序进程中添加了错误事件,以支持 V8 致命错误的诊断报告。#43997
- 添加了
View.setBorderRadius(radius)用于自定义视图的边框半径——兼容WebContentsView。#42320 - 扩展了
navigationHistoryAPI,增加了 2 个新功能以更好地管理历史记录。#42014
重大变化
🌐 Breaking Changes
已移除:macOS 10.15 支持
🌐 Removed: macOS 10.15 support
macOS 10.15(Catalina)不再受到 Chromium 的支持。
🌐 macOS 10.15 (Catalina) is no longer supported by Chromium.
较旧版本的 Electron 将继续在 Catalina 上运行,但要运行 Electron v33.0.0 及更高版本,则需要 macOS 11(Big Sur)或更高版本。
🌐 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。使用原生 Node 模块的开发者应使用 --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 和 baseURLForDataURL 属性在 BrowserWindow.loadURL、WebContents.loadURL 和 <webview>.loadURL 上。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');
行为已更改:app 上的 login 的 webContents 属性
🌐 Behavior Changed: webContents property on login on app
app 的 login 事件中的 webContents 属性在使用 respondToAuthRequestsFromMainProcess 选项创建的实用程序进程的请求触发事件时将为 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
🌐 End of Support for 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.