跳转到主内容

Electron 39.0.0

· 阅读时间:约 4 分钟

Electron 39.0.0 已发布! 它包括对 Chromium 142.0.7444.52、V8 14.2 和 Node 22.20.0 的升级。


Electron 团队很高兴发布了 Electron 39.0.0 ! 你可以通过 npm install electron@latest 或者从我们的发布网站下载它。 继续阅读此版本的详细信息。

如果您有任何反馈,请在 BlueskyMastodon 上与我们分享,或加入我们的 Discord 社区! Bug 和功能请求可以在 Electron 的问题跟踪器中报告。

重要变化

架构(Stack)更新

Electron 39 upgrades Chromium from 140.0.7339.41 to 142.0.7444.52, Node.js from 22.18.0 to v22.20.0, and V8 from 14.0 to 14.2.

ASAR Integrity graduates to stable

A long-standing "experimental" feature -- ASAR integrity -- is now stable in Electron 39. When you enable this feature, it validates your packaged app.asar at runtime against a build-time hash to detect any tampering. If no hash is present or if there is a mismatch in the hashes, the app will forcefully terminate.

See the ASAR integrity documentation for full information on how on the feature works, on how to use it in your application, and how to use it in Electron Forge and Electron Packager.

In related news, Electron Packager v19 now enables ASAR by default. #1841

New Features and Improvements

  • 添加 app.isHardwareAccelerationEnabled()#48680
  • Added RGBAF16 output format with scRGB HDR color space support to Offscreen Rendering. #48504
  • Added methods to enable more granular accessibility support management. #48625
  • Added support for USBDevice.configurations. #47459
  • Added the ability to retrieve the system accent color on Linux using systemPreferences.getAccentColor. #48628
  • Allowed for persisting File System API grant status within a given session. #48326 (Also in 37, 38)
  • Support dynamic ESM imports in non-context isolated preloads. #48488 (Also in 37, 38)
  • Marked the ASAR integrity feature as stable. It had previously been experimental. #48434

重大更改

Deprecated: --host-rules command line switch

Chromium is deprecating the --host-rules switch.

You should use --host-resolver-rules instead.

Behavior Changed: window.open popups are always resizable

Per current WHATWG spec, the window.open API will now always create a resizable popup window.

To restore previous behavior:

webContents.setWindowOpenHandler((details) => {
return {
action: 'allow',
overrideBrowserWindowOptions: {
resizable: details.features.includes('resizable=yes'),
},
};
});

Behavior Changed: shared texture OSR paint event data structure

When using the shared texture offscreen rendering feature, the paint event now emits a more structured object. It moves the sharedTextureHandle, planes, modifier into a unified handle property. See the OffscreenSharedTexture documentation for more details.

终止对 36.x.y 的支持

根据项目的支持政策,Electron 36.x.y 已经达到了支持的终点。 我们鼓励开发者将应用程序升级到更新的 Electron 版本。

E39 (Oct'25)E40 (Jan'26)E41 (Feb'26)
39.x.y40.x.y41.x.y
38.x.y39.x.y40.x.y
37.x.y38.x.y39.x.y

接下来

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

您可以在此处找到 Electron 的公开时间表

有关这些和未来变化的更多信息可在计划的突破性变化页面找到。