Electron 26.0.0
Electron 26.0.0 现已发布! 它包括对 Chromium 116.0.5845.62
、V8 11.2
和 Node.js 18.16.1
的升级。 请继续阅读以获取更多详细信息!
Electron 团队很高兴地宣布 Electron 26.0.0 的发布! 你可以从 npm 通过 npm install electron@latest
来安装它,或者从我们的发布网站下载它。 请继续阅读有关此版本的详细信息。
如果您有任何反馈,请在 Twitter 上与我们分享,或加入我们的社区 Discord! 欢迎在 Electron 的 issue tracker 中报告 Bug 和功能请求。
重要变更
技术栈变更
- Chromium
116.0.5845.62
- Node.js
18.16.1
- V8
11.2
破坏性变更
已废弃:webContents.getPrinters
webContents.getPrinters
方法已被废弃。 请改用 webContents.getPrintersAsync
。
const w = new BrowserWindow({ show: false });
// Deprecated
console.log(w.webContents.getPrinters());
// Replace with
w.webContents.getPrintersAsync().then((printers) => {
console.log(printers);
});
已废弃:systemPreferences.{get,set}AppLevelAppearance
和 systemPreferences.appLevelAppearance
systemPreferences.getAppLevelAppearance
和 systemPreferences.setAppLevelAppearance
方法以及 systemPreferences.appLevelAppearance
属性已被废弃。 请改用 nativeTheme
模块。
// Deprecated
systemPreferences.getAppLevelAppearance();
// Replace with
nativeTheme.shouldUseDarkColors;
// Deprecated
systemPreferences.appLevelAppearance;
// Replace with
nativeTheme.shouldUseDarkColors;
// Deprecated
systemPreferences.setAppLevelAppearance('dark');
// Replace with
nativeTheme.themeSource = 'dark';
已废弃:systemPreferences.getColor
的 alternate-selected-control-text
值
systemPreferences.getColor
的 alternate-selected-control-text
值已被废弃。 请改用 selected-content-background
。
// Deprecated
systemPreferences.getColor('alternate-selected-control-text');
// Replace with
systemPreferences.getColor('selected-content-background');
新特性
- 添加了
safeStorage.setUsePlainTextEncryption
和safeStorage.getSelectedStorageBackend
API。 #39107 - 添加了
safeStorage.setUsePlainTextEncryption
和safeStorage.getSelectedStorageBackend
API。 #39155 - 为通过
ipcRenderer.sendTo()
发送的消息添加了senderIsMainFrame
。 #39206 - 增加了对将菜单标记为由键盘启动的支持。 #38954
停止对 23.x.y 的支持
根据项目的支持政策,Electron 23.x.y 已停止支持。 鼓励开发者和应用程序升级到较新版本的 Electron。
E26 (23年8月) | E27 (23年10月) | E28 (24年1月) |
---|---|---|
26.x.y | 27.x.y | 28.x.y |
25.x.y | 26.x.y | 27.x.y |
24.x.y | 25.x.y | 26.x.y |
22.x.y |
下一步计划
短期内,您可以预期团队将继续专注于跟进构成 Electron 的主要组件(包括 Chromium、Node 和 V8)的开发。
您可以在此处找到 Electron 的公开时间线。
有关未来变更的更多信息,请参阅计划中的破坏性变更页面。