跳到主要內容

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 的 issue tracker 中回報。

重點變更

堆疊變更

重大變更

已棄用: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
  • 在透過 ipcRenderer.sendTo() 發送的訊息中新增 senderIsMainFrame#39206
  • 新增支援將選單標記為由鍵盤啟動。 #38954

終止對 23.x.y 的支援

根據專案的支援政策,Electron 23.x.y 已終止支援。建議開發人員和應用程式升級到較新版本的 Electron。

E26 (八月'23)E27 (十月'23)E28 (一月'24)
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 的公開時程表

有關未來變更的更多資訊,請參閱計畫的重大變更頁面。