Skip to main content

Electron 15.0.0

· 9 min read

Electron 15.0.0 已发布!它包含对 Chromium 94、V8 9.4 和 Node.js 16.5.0 的升级。我们添加了 window.open 的 API 更新、错误修复和常规改进。请阅读下文了解更多详情!

¥Electron 15.0.0 has been released! It includes upgrades to Chromium 94, V8 9.4, and Node.js 16.5.0. We've added API updates to window.open, bug fixes, and general improvements. Read below for more details!


Electron 团队非常高兴地宣布 Electron 15.0.0 正式发布!你可以通过 npm install electron@latest 使用 npm 安装它,也可以从我们的 发布网站。继续阅读以了解有关此版本的详细信息,并请分享你的任何反馈!

¥The Electron team is excited to announce the release of Electron 15.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 and please share any feedback you have!

显著变化

¥Notable Changes

Electron 发布节奏变更

¥Electron Release Cadence Change

从 Electron 15 开始,Electron 将每 8 周发布一个新的主要稳定版本。你可以阅读 完整详情请见此处

¥Starting with Electron 15, Electron will release a new major stable version every 8 weeks. You can read the full details here.

此外,Electron 的支持版本将从最新三个版本更改为最新四个版本,有效期至 2022 年 5 月。有关 Electron 版本控制的更多详细信息,请参阅 查看我们的版本控制文档

¥Additionally, Electron will be changing supported versions from latest three versions to latest four versions until May 2022. See our versioning documentfor more detailed information about versioning in Electron.

技术栈变更

¥Stack Changes

亮点功能

¥Highlight Features

  • nativeWindowOpen: true 不再是实验性的,现在是默认值。

    ¥nativeWindowOpen: true is no longer experimental, and is now the default.

  • 添加了 safeStorage 字符串加密 API。#30430

    ¥Added safeStorage string encryption API. #30430

  • WebContents 上添加了 'frame-created' 事件,该事件在页面中创建框架时触发。#30801

    ¥Added 'frame-created' event to WebContents which emits when a frame is created in the page. #30801

  • BrowserWindowwill-resize 事件添加了调整 edge 大小的信息。#29199

    ¥Added resize edge info to BrowserWindow's will-resize event. #29199

请参阅 15.0.0 发行说明 获取新功能和变更的完整列表。

¥See the 15.0.0 release notes for a full list of new features and changes.

重大变化

¥Breaking Changes

以下是 Electron 15 中引入的重大变更。有关这些变更和未来变更的更多信息,请参阅 计划中的突发事件变更 页面。

¥Below are breaking changes introduced in Electron 15. More information about these and future changes can be found on the Planned Breaking Changes page.

默认更改:nativeWindowOpen 默认为 true

¥Default Changed: nativeWindowOpen defaults to true

在 Electron 15 之前,window.open 默认情况下使用 BrowserWindowProxy。这意味着 window.open('about:blank') 无法打开同步可编写脚本的子窗口,以及其他不兼容性。nativeWindowOpen: true 不再是实验性的,现在是默认值。

¥Prior to Electron 15, window.open was by default shimmed to use BrowserWindowProxy. This meant that window.open('about:blank') did not work to open synchronously scriptable child windows, among other incompatibilities. nativeWindowOpen: true is no longer experimental, and is now the default.

请参阅 Electron 中的 window.open 文档了解更多详情。

¥See the documentation for window.open in Electron for more details.

API 变更

¥API Changes

  • WebContents 上添加了 'frame-created' 事件,该事件在页面中创建框架时触发。#30801

    ¥Added 'frame-created' event to WebContents which emits when a frame is created in the page. #30801

  • 添加了 safeStorage 字符串加密 API。#30430

    ¥Added safeStorage string encryption API. #30430

  • dialog.showMessageBox 中添加了 signal 选项。#26102

    ¥Added signal option to dialog.showMessageBox. #26102

  • 添加了 Electron Fuse,用于在应用加载的 app.asar 文件上强制执行代码签名。需要最新的 asar 模块(v3.1.0 或更高版本)。#30900

    ¥Added an Electron Fuse for enforcing code signatures on the app.asar file your application loads. Requires the latest asar module (v3.1.0 or higher). #30900

  • 添加了保险丝,用于在打包应用中禁用 NODE_OPTIONS--inspect 调试参数。#30420

    ¥Added fuses to disable NODE_OPTIONS and --inspect debug arguments in packaged apps. #30420

  • 添加了新的 MenuItem.userAccelerator 属性,用于读取用户分配的 macOS 加速器覆盖。#26682

    ¥Added new MenuItem.userAccelerator property to read user-assigned macOS accelerator overrides. #26682

  • 添加了新的 app.runningUnderARM64Translation 属性,用于检测何时在 Apple Silicon 上的 Rosetta 下运行,或在 Windows 上为 ARM 运行 WOW。#29168

    ¥Added new app.runningUnderARM64Translation property to detect when running under Rosetta on Apple Silicon, or WOW on Windows for ARM. #29168

  • 添加了新的 imageAnimationPolicy Web 首选项,用于控制图片的动画方式。#29095

    ¥Added new imageAnimationPolicy web preference to control how images are animated. #29095

  • 添加了对通过上下文桥发送 Blob 的支持。#29247

    ¥Added support for sending Blobs over the context bridge. #29247

移除/弃用的变更

¥Removed/Deprecated Changes

未删除或弃用任何 API。

¥No APIs have been removed or deprecated.

支持的版本

¥Supported Versions

从 Electron 15 开始,我们将支持从最新的三个版本更改为最新的四个版本,直到 2022 年 5 月 Electron 19 为止。Electron 19 发布后,我们将恢复对最新三个版本的支持。此版本支持更改是我们新节奏更改的一部分。请参阅 我们的博客文章,详情请点击此处

¥Starting in Electron 15, we will change supported versions from latest three versions to latest four versions until May 2022 with Electron 19. After Electron 19, we will return to supporting the latest three versions. This version support change is part of our new cadence change. Please see our blog post for full details here.

建议开发者和应用升级到较新版本的 Electron。

¥Developers and applications are encouraged to upgrade to a newer version of Electron.

E15 (2021 年 9 月)E16 (2021 年 11 月)E17 (2022 年 2 月)E18 (2022 年 3 月)E19 (2022 年 5 月)
15.x.y16.x.y17.x.y18.x.y19.x.y
14.x.y15.x.y16.x.y17.x.y18.x.y
13.x.y14.x.y15.x.y16.x.y17.x.y
12.x.y13.x.y14.x.y15.x.y--

下一步计划

¥What's Next

短期内,你可以预期团队将继续专注于跟上构成 Electron 的主要组件(包括 Chromium、Node 和 V8)的开发。虽然我们谨慎地不对发布日期做出承诺,但我们计划大约每季度发布一次 Electron 的新主要版本及其组件的新版本。

¥In the short term, you can expect the team to continue to focus on keeping up with the development of the major components that make up Electron, including Chromium, Node, and V8. Although we are careful not to make promises about release dates, our plan is release new major versions of Electron with new versions of those components approximately quarterly.

你可以找到 Electron 公开时间线

¥You can find Electron's public timeline here.

有关未来变更的更多信息,请参阅 计划中的突发事件变更 页面。

¥More information about future changes can be found on the Planned Breaking Changes page.