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 跟踪器 中报告。
显著变化
技术栈变更
- 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 (Aug'23) | E27 (Oct'23) | E28 (Jan'24) |
---|---|---|
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 的公共时间表。
有关未来更改的更多信息,请访问“计划的破坏性变更”页面。