Skip to main content

Electron 42

· 12 min read

Electron 42 已发布!它包括对 Chromium 148.0.7778.96、V8 14.8 和 Node v24.15.0 的升级。

🌐 Electron 42 has been released! It includes upgrades to Chromium 148.0.7778.96, V8 14.8, and Node v24.15.0.


Electron 团队很高兴地宣布发布 Electron 42!你可以通过 npm install electron@latest 使用 npm 安装,或从我们的 发布网站 下载。继续阅读以了解有关此版本的详细信息。

🌐 The Electron team is excited to announce the release of Electron 42! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.

如果你有任何反馈,请通过 BlueskyMastodon 与我们分享,或者加入我们的社区 Discord!可以在 Electron 的 问题追踪器 报告漏洞和功能请求。

🌐 If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

技术讨论:Electron 如何原生支持 Wayland,以及这对你的应用意味着什么

· 23 min read
info

技术讲座是一个新的博客文章系列,我们在其中分享关于 Electron 的工作点滴。如果你觉得这项工作有趣,请考虑贡献

去年秋天,Electron 在 Linux 上切换到 Wayland 时,大多数人没有注意到。

🌐 When Electron switched to Wayland on Linux last fall, most people didn't notice.

主要的 Linux 发行版多年前就采用了现代显示协议,KDE Plasma 和 GNOME 桌面环境都正在完全放弃 X11 支持

🌐 Major Linux distributions adopted the modern display protocol years ago, and both the KDE Plasma and GNOME desktop environments are in the process of dropping X11 support completely.

但是,如果没有应用,平台迁移就不算完成,而很大一部分 Linux 应用生态系统在去年八月经历了第二次 Wayland 转型——那时大多数发行版已经更改了默认设置。那时 Chromium 默认启用了 Wayland,同时带动了 Electron 和数十个 Linux 桌面应用。

🌐 But a platform migration isn't complete without apps, and a large part of the Linux app ecosystem went through a second Wayland transition last August — well after most distros had changed their defaults. That's when Chromium turned on Wayland by default, bringing Electron and dozens of Linux desktop apps along with it.

Electron 41

· 11 min read

Electron 41 已发布!它包括对 Chromium 146.0.7680.65、V8 14.6 和 Node v24.14.0 的升级。

🌐 Electron 41 has been released! It includes upgrades to Chromium 146.0.7680.65, V8 14.6, and Node v24.14.0.


Electron 团队很高兴地宣布发布 Electron 41!你可以通过 npm install electron@latest 使用 npm 安装,或从我们的 发布网站 下载。继续阅读以了解有关此版本的详细信息。

🌐 The Electron team is excited to announce the release of Electron 41! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.

如果你有任何反馈,请通过 BlueskyMastodon 与我们分享,或者加入我们的社区 Discord!可以在 Electron 的 问题追踪器 报告漏洞和功能请求。

🌐 If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

info

在发布初始的 41.0.0 版本包之后,我们将一些高优先级的错误整合到了后续的补丁版本中。我们建议在升级到 Electron 41 时安装 41.0.2

显著变化

🌐 Notable Changes

ASAR 完整性摘要以提升安全性

🌐 ASAR Integrity digest for improved security

自 Electron 41 起,macOS 的 Electron 应用现在可以嵌入其 ASAR 完整性 信息的摘要。这为使用 ASAR 完整性的应用增加了额外的篡改检测层,通过在应用启动时验证完整性信息本身。

🌐 As of Electron 41, macOS Electron apps can now embed a digest of their ASAR Integrity information. This adds an additional layer of tamper detection for apps that use ASAR Integrity by validating the integrity information itself at app launch.

要在你的应用中启用此功能,你可以在 @electron/asar v4.1.0 及以上版本运行以下命令:

🌐 To enable the feature for your app, you can run the following command with @electron/asar v4.1.0 and above:

asar integrity-digest on /path/to/YourApp.app

你之后必须重新签署你的应用。有关更多信息,请参阅 @electron/asar CLI 文档。

🌐 You must re-sign your app afterwards. For more information, see the @electron/asar CLI documentation.

Electron Forge 对此功能的支持计划在不久的将来推出 (electron/forge#4159)。

🌐 Support for this feature in Electron Forge is planned for the near future (electron/forge#4159).

改进的Wayland支持

🌐 Improved Wayland support

在 Wayland(Linux)上,无边框窗口现在具有投影和扩展的调整大小边界。要创建完全无边框且没有装饰的窗口,请在窗口构造函数中设置 hasShadow: false#49885

🌐 On Wayland (Linux), frameless windows now have drop shadows and extended resize boundaries. To create fully frameless windows with no decorations, set hasShadow: false in the window constructor. #49885

Mitchell Cohen 写了一篇关于最近改进 Electron 对 Linux 上 Wayland 和客户端装饰支持的工作 博客文章

已添加对 MSIX 自动更新的支持

🌐 Added support for MSIX auto-updating

Electron 团队最近根据 RFC #21 添加了 MSIX 自动更新支持。现在,你可以在更新服务器中同时发布 MSIX 和 Squirrel.Mac,基本上使用相同的 JSON 响应格式。更多信息请参阅 autoUpdater 文档

🌐 The Electron team recently added MSIX auto-updater support according to RFC #21. You can now ship both MSIX and Squirrel.Mac in your update server essentially with the same JSON response format. See the autoUpdater documentation for more information.

这是由 #49586 在 Electron 41 中添加的,并且也已经回移植到 Electron 39.5.0 (#49585) 和 40.2.0 (#49587)。

🌐 This was added in Electron 41 by #49586 and has also been backported to Electron 39.5.0 (#49585) and 40.2.0 (#49587).

Electron 40.0.0

· 5 min read

Electron 40.0.0 已发布!它包括对 Chromium 144.0.7559.60、V8 14.4 和 Node 24.11.1 的升级。

🌐 Electron 40.0.0 has been released! It includes upgrades to Chromium 144.0.7559.60, V8 14.4, and Node 24.11.1.


Electron 团队很高兴地宣布发布 Electron 40.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。

🌐 The Electron team is excited to announce the release of Electron 40.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.

如果你有任何反馈,请通过 BlueskyMastodon 与我们分享,或者加入我们的社区 Discord!可以在 Electron 的 问题追踪器 报告漏洞和功能请求。

🌐 If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

技术讲座:改进窗口调整大小的行为

· 26 min read

我们将推出一个新的博客文章系列,分享我们在 Electron 上工作的点滴。如果你对这项工作感兴趣,请考虑贡献

🌐 We're launching a new blog post series where we share glimpses into our work on Electron. If you find this work interesting, please consider contributing!


最近,我在改进 Electron 和 Chromium 的窗口调整大小行为。

🌐 Recently, I worked on improving Electron and Chromium's window resize behavior.

这个虫子

🌐 The bug

我们在 Windows 上遇到了一个问题,在调整窗口大小时旧的帧会变得可见:

🌐 We were seeing an issue on Windows where old frames would become visible while resizing a window:

Animated GIF showing the issue where old frames would be shown while resizing windows

是什么让这个漏洞特别有趣?

🌐 What made this bug particularly interesting?

  1. 很有挑战性。
  2. 它位于一个大型代码库的深处。
  3. 正如你稍后会看到的,系统内部其实有两个不同的漏洞。

修复错误

🌐 Fixing the bug

遇到这样的漏洞,首先的挑战是确定从哪里开始调查。

🌐 With a bug like this, the first challenge is figuring out where to start looking.

Electron 构建在 Chromium 之上,Chromium 是 Google Chrome 的开源版本。在编译 Electron 时,Electron 的源代码会作为子目录添加到 Chromium 的源代码树中。然后,Electron 依赖 Chromium 的代码来提供现代浏览器的大部分功能。

🌐 Electron builds upon Chromium, the open source version of Google Chrome. When compiling Electron, Electron's source code is added into the Chromium source tree as a subdirectory. Electron then relies on Chromium's code to provide most of the functionality of a modern browser.

Chromium 大约有 3600 万行代码。Electron 也是一个大型项目。这有很多代码可能会导致这个问题。

🌐 Chromium has about 36 million lines of code. Electron is a large project, too. That is a lot of code that could be causing this issue.

十二月宁静月(12月25日)

· 5 min read

从12月1日起,Electron 项目将进入一个静默期,并将在2026年1月恢复全面运作。有关详细信息,请参见下方的政策部分。

🌐 Starting December 1, the Electron project will enter a quiet period before picking back up at full capacity in January 2026. For full details, see the Policies section below.

自2020年以来,十二月一直是项目维护者从日常维护工作中喘息一下的时期,以便剩余或专注于深入工作。这段剩余有助于我们恢复精力,为即将到来的一年充满活力地回归。

🌐 Since 2020, December has been a time for project maintainers to take a breather from regular maintenance duties in order to take a break or focus on heads-down work. This break helps us rest up and come back energized for the year to come.

也就是说,像这样为期一个月的暂停只有在开源项目处于健康状态时才能实现——我们要感谢所有维护者和外部贡献者,感谢你们持续不断的努力,推动项目不断前进。❤️

🌐 That said, a month-long pause like this one is only achievable when an open-source project is in a healthy state—we’d like to thank all maintainers and external contributors for all of their continued efforts to keep the project moving. ❤️

Electron 39.0.0

· 8 min read

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

🌐 Electron 39.0.0 has been released! It includes upgrades to Chromium 142.0.7444.52, V8 14.2, and Node 22.20.0.


Electron 团队很高兴地宣布发布 Electron 39.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。

🌐 The Electron team is excited to announce the release of Electron 39.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.

如果你有任何反馈,请通过 BlueskyMastodon 与我们分享,或者加入我们的社区 Discord!可以在 Electron 的 问题追踪器 报告漏洞和功能请求。

🌐 If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

显著变化

🌐 Notable Changes

ASAR 完整性升级为稳定版

🌐 ASAR Integrity graduates to stable

一个长期存在的“实验性”功能——ASAR 完整性——现在在 Electron 39 中变得稳定。当你启用此功能时,它会在运行时将你打包的 app.asar 与构建时的哈希值进行验证,以检测是否有任何篡改。如果没有哈希值或哈希值不匹配,应用将被强制终止。

🌐 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.

请参阅 ASAR 完整性文档 以获取有关该功能的完整信息,包括功能的工作原理、如何在应用中使用它,以及如何在 Electron Forge 和 Electron Packager 中使用它。

🌐 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.

相关新闻,Electron Packager v19 现在默认启用 ASAR。#1841

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

Electron 38.0.0

· 7 min read

Electron 38.0.0 已发布!它包括对 Chromium 140.0.7339.41、V8 14.0 和 Node 22.16.0 的升级。

🌐 Electron 38.0.0 has been released! It includes upgrades to Chromium 140.0.7339.41, V8 14.0, and Node 22.16.0.


Electron 团队很高兴地宣布发布 Electron 38.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。

🌐 The Electron team is excited to announce the release of Electron 38.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.

如果你有任何反馈,请通过 BlueskyMastodon 与我们分享,或者加入我们的社区 Discord!可以在 Electron 的 问题追踪器 报告漏洞和功能请求。

🌐 If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

Electron 37.0.0

· 10 min read

Electron 37.0.0 已发布!它包括对 Chromium 138、V8 13.8 和 Node 22.16.0 的升级。

🌐 Electron 37.0.0 has been released! It includes upgrades to Chromium 138, V8 13.8, and Node 22.16.0.


Electron 团队很高兴地宣布发布 Electron 37.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。

🌐 The Electron team is excited to announce the release of Electron 37.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.

如果你有任何反馈,请通过 BlueskyMastodon 与我们分享,或者加入我们的社区 Discord!可以在 Electron 的 问题追踪器 报告漏洞和功能请求。

🌐 If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

Google Summer of Code 开始

🌐 Google Summer of Code Begins

我们两位 Google Summer of Code 贡献者已经开始了该项目的编码阶段!

🌐 Our two Google Summer of Code contributors have started the program's coding period!

  • @nilayarya 正在 Electron 核心中开发一个新的 保存/恢复窗口状态 API。新的 API 将提供一种内置的、标准化的方式来处理窗口状态的持久化。详见 Nilay 正在进行中的 RFC:electron/rfcs#16
  • @hitarth-gg 正在努力使用 Chrome Manifest V3 API 现代化长期未活跃的 Devtron 扩展。该项目将为开发者提供工具,以调试 IPC 通信、跟踪事件监听器,并可视化他们的 Electron 应用中的模块依赖。

对于我们的 GSOC 参与者来说,这几周是令人兴奋的,敬请期待更多更新!

🌐 It has been an exciting couple of weeks for our GSOC participants, so stay tuned for more updates!

显著变化

🌐 Notable Changes

圆角平滑:原生 CSS Squircle

🌐 Smooth Corners: Native CSS Squircles

An image showing different corner smoothing values (0%, 30%, 60%, and 100%) applied to rectangles, with 60% labeled as matching macOS style

Electron 37 引入了自定义 -electron-corner-smoothing CSS 属性,这使应用能够创建更平滑的圆角,以匹配苹果 macOS 的设计风格。这个功能最初是在 Electron 36 中推出的,但我们觉得它值得获得更多关注。

🌐 Electron 37 introduces the custom -electron-corner-smoothing CSS property, which allows apps to create smoother rounded corners to match Apple's macOS design language. This feature originally landed in Electron 36, but we felt like it deserved a brighter spotlight.

100% 圆角平滑示例

代码结果
.box {
width: 128px;
height: 128px;
border-radius: 24px;
-electron-corner-smoothing: 100%;
}

与标准的 border-radius 属性不同,它会从矩形上切出四分之一圆角,-electron-corner-smoothing 会将曲线平滑地过渡为具有连续周长的 方形圆 形状。

🌐 Unlike the standard border-radius property, which carves quarter-circle corners out of a rectangle, -electron-corner-smoothing smoothly transitions the curve into a squircle shape with a continuous perimeter.

你可以使用 0% 到 100% 的数值来调整平滑度,或者使用 system-ui 值以匹配操作系统的风格(macOS 上为 60%,其他系统为 0%)。 这一设计增强可以应用于边框、轮廓和阴影,为你的应用增添一层细腻的精致感。

🌐 You can adjust the smoothness using values from 0% to 100%, or use the system-ui value to match the operating system's style (60% on macOS and 0% otherwise). This design enhancement can be applied on borders, outlines, and shadows, giving your app a subtle layer of polish.

tip

阅读更多关于 Electron 中 squircles 实现的信息,请参见 @clavinRFC 0012。 该文档更详细地介绍了动机和技术实现。

初始设计灵感来自 Figma 的圆角平滑实现。想了解他们为实现圆角平滑所做的探索,请阅读 《拼命寻找 squircles》

Electron 36.0.0

· 8 min read

Electron 36.0.0 已发布!它包括对 Chromium 136、V8 13.6 和 Node 22.14.0 的升级。

🌐 Electron 36.0.0 has been released! It includes upgrades to Chromium 136, V8 13.6, and Node 22.14.0.


Electron 团队很高兴地宣布发布 Electron 36.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。

🌐 The Electron team is excited to announce the release of Electron 36.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.

如果你有任何反馈,请通过 BlueskyMastodon 与我们分享,或者加入我们的社区 Discord!可以在 Electron 的 问题追踪器 报告漏洞和功能请求。

🌐 If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

显著变化

🌐 Notable Changes

写作工具支持

🌐 Writing Tools Support

在 Electron 36 中,你可以在上下文菜单中启用 macOS 系统级功能,例如写作工具(拼写和语法检查)、自动填充以及服务菜单项。要实现此功能,请将一个 WebFrameMain 实例传入 menu.popup()frame 参数中。

🌐 In Electron 36, you can enable macOS system-level features like Writing Tools (spelling and grammar), Autofill, and Services menu items in your context menus. To do so, pass a WebFrameMain instance into the frame parameter for menu.popup().

import { BrowserWindow, Menu, WebFrameMain } from 'electron';

const currentWindow = BrowserWindow.getFocusedWindow();
const focusedFrame = currentWindow.webContents.focusedFrame;
const menu = Menu.buildFromTemplate([{ label: 'Copy', role: 'copy' }]);

menu.popup({
window: currentWindow,
frame: focusedFrame,
});