跳到主要内容

Electron 26.0.0

·2 分钟阅读

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 的问题跟踪器中报告。

值得注意的更改

堆栈更改

重大更改

已弃用: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}AppLevelAppearancesystemPreferences.appLevelAppearance

systemPreferences.getAppLevelAppearancesystemPreferences.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.getColoralternate-selected-control-text

systemPreferences.getColoralternate-selected-control-text 值已弃用。请改用 selected-content-background

// Deprecated
systemPreferences.getColor('alternate-selected-control-text');
// Replace with
systemPreferences.getColor('selected-content-background');

新功能

  • 添加了 safeStorage.setUsePlainTextEncryptionsafeStorage.getSelectedStorageBackend API。#39107
  • 添加了 safeStorage.setUsePlainTextEncryptionsafeStorage.getSelectedStorageBackend API。#39155
  • senderIsMainFrame 添加到通过 ipcRenderer.sendTo() 发送的消息。#39206
  • 添加了对将菜单标记为键盘启动的支持。#38954

23.x.y 版本终止支持

根据项目的支持策略,Electron 23.x.y 已达到支持终止。鼓励开发人员和应用程序升级到更新版本的 Electron。

E26 (23 年 8 月)E27 (23 年 10 月)E28 (24 年 1 月)
26.x.y27.x.y28.x.y
25.x.y26.x.y27.x.y
24.x.y25.x.y26.x.y
22.x.y

下一步是什么

在短期内,您可以预期该团队将继续专注于跟上构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。

您可以在这里找到Electron 的公共时间表

有关未来更改的更多信息,请参阅计划的重大更改页面。