跳转到主内容

40 篇博文 含有标签「发行版」

查看所有标签

Electron 22.0.0

· 阅读时间:约 7 分钟

Electron 22.0.0 已发布! 它包括了一个新的实用进程 API、对 Windows 7/8/8.1 支持的更新,以及对 Chromium 108、V8 10.8 和 Node.js 16.17.1 的升级。 请阅读下文了解更多详情!


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

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

重要变化

架构(Stack)更新

主要特性

UtilityProcess API #36089

新的 UtilityProcess 主进程模块允许创建仅集成 Node.js 的轻量级 Chromium 子进程,同时还允许使用 MessageChannel 与沙盒渲染器进行通信。 该API是基于Node.js的 child_process.fork 设计的,以允许更容易的过渡,一个主要的区别是,入口点 modulePath 必须来自打包的应用程序内,以允许只加载受信任的脚本。 此外,该模块默认情况下会阻止与渲染器建立通信通道,以保证主进程是应用程序中唯一受信任进程。

您可以在此处阅读有关我们文档中的新 UtilityProcess API 的更多信息。

Windows 7/8/8.1 支持更新

info

2023/02/16: An update on Windows Server 2012 support

Last month, Google announced that Chrome 109 would continue to receive critical security fixes for Windows Server 2012 and Windows Server 2012 R2 until October 10, 2023. In accordance, Electron 22's (Chromium 108) planned end of life date will be extended from May 30, 2023 to October 10, 2023. The Electron team will continue to backport any security fixes that are part of this program to Electron 22 until October 10, 2023.

Note that we will not make additional security fixes for Windows 7/8/8.1. Also, Electron 23 (Chromium 110) will only function on Windows 10 and above as previously announced.

Electron 22 将是最后一个支持 Windows 7/8/8.1 的 Electron 主要版本。 Electron 遵循计划中的 Chromium 弃用政策,该政策将 [在 Chromium 109 中弃用 Windows 7/8/8.1 支持(在此处阅读更多信息)](https://support.google.com/chrome/thread/185534985/sunsetting-support-for-windows-7-8-8-1-in-early -2023?hl=en)。

Electron 23 及以后的主要版本将不支持 Windows 7/8/8.1。

其他显著的更改

  • 添加了对 Linux 和 Windows 上的 Web Bluetooth pin 配对的支持。 #35416
  • 添加了 LoadBrowserProcessSpecificV8Snapshot 作为新的 Fuse(引信),让主/浏览器进程从位于 browser_v8_context_snapshot.bin的文件加载其 v8 快照。 任何其他进程将使用与之相同的路径。 #35266
  • 添加了 WebContents.opener 以访问窗口打开器和 webContents.fromFrame(frame) 以获取与 WebFrameMain 实例对应的 WebContents。 #35140
  • 通过新的会话处理程序 ses.setDisplayMediaRequestHandler 添加了对 navigator.mediaDevices.getDisplayMedia 的支持。 #30702

重要的API变更

以下是 Electron 22 中引入的破坏性变更。 您可以在 Planned Breaking Changes 页面上阅读有关这些更改和未来更改的更多信息。

已废弃:webContents.incrementCapturerCount(stayHidden, stayAwake)

webContents.incrementCapturerCount(stayHidden, stayAwake) 已被弃用。 当页面捕获完成时,它现在由 webContents.capturePage 自动处理。

const w = new BrowserWindow({ show: false })

- w.webContents.incrementCapturerCount()
- w.capturePage().then(image => {
- console.log(image.toDataURL())
- w.webContents.decrementCapturerCount()
- })

+ w.capturePage().then(image => {
+ console.log(image.toDataURL())
+ })

已废弃:webContents.decrementCapturerCount(stayHidden, stayAwake)

webContents.decrementCapturerCount(stayHidden, stayAwake) 已弃用。 当页面捕获完成时,它现在由 webContents.capturePage 自动处理。

const w = new BrowserWindow({ show: false })

- w.webContents.incrementCapturerCount()
- w.capturePage().then(image => {
- console.log(image.toDataURL())
- w.webContents.decrementCapturerCount()
- })

+ w.capturePage().then(image => {
+ console.log(image.toDataURL())
+ })

已废弃: WebContents new-window 事件

WebContents 中的 new-window 事件已经被废弃。 已弃用:webContents.setWindowOpenHandler()

- webContents.on('new-window', (event) => {
- event.preventDefault()
- })

+ webContents.setWindowOpenHandler((details) => {
+ return { action: 'deny' }
+ })

已废弃:Browserwindow scroll-touch-* 事件

在 BrowserWindow 上已弃用的 scroll-touch-beginscroll-touch-endscroll-touch-edge 事件已被删除。 Instead, use the newly available input-event event on WebContents.

// Deprecated
- win.on('scroll-touch-begin', scrollTouchBegin)
- win.on('scroll-touch-edge', scrollTouchEdge)
- win.on('scroll-touch-end', scrollTouchEnd)

// Replace with
+ win.webContents.on('input-event', (_, event) => {
+ if (event.type === 'gestureScrollBegin') {
+ scrollTouchBegin()
+ } else if (event.type === 'gestureScrollUpdate') {
+ scrollTouchEdge()
+ } else if (event.type === 'gestureScrollEnd') {
+ scrollTouchEnd()
+ }
+ })

终止对 19.x.y 的支持

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

E19 (2022年5月)E20 (8月22日)E21 (2022年9月)E22(22 年 11 月)E23(23 年 1 月)
19.x.y20.x.y21.x.y22.x.y23.x.y
18.x.y19.x.y20.x.y21.x.y22.x.y
17.x.y18.x.y19.x.y20.x.y21.x.y

接下来

Electron 项目将于 2022 年 12 月暂停,并于 2023 年 1 月恢复。 更多信息可以在 12 月关闭博客文章 中找到。

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

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

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

Electron 21.0.0

· 阅读时间:约 4 分钟

Electron 21.0.0 已发布! 此次升级中包含 Chromium 106, V8 10.6, 和 Node.js 16.16.0。 请阅读下文了解更多详情!


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

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

重要变化

架构(Stack)更新

新特性

  • 已添加 webFrameMain.origin#35534
  • 添加新的 WebContents.ipcWebFrameMain.ipc API。 #35231
  • 添加支持类似面板的行为。 窗口可以浮动在全屏应用上。 #34388
  • 添加对 macOS 应用的 APN 推送通知的支持。 #33574

破坏性的 API 变更

以下是 Electron 21 中引入的破坏性变更。

V8 Memory Cage 已启用

Electron 21 启用 V8 沙盒指针,继 Chrome 决定在 Chrome 103 做同样的事情。 这对原生模块有一定的影响。 此功能具有性能和安全优势,但也对原生模块施加了一些新的限制,例如,使用指向外部(“堆外”)内存的 ArrayBuffers。 更多信息请查看 博客文章#34724

重构 webContents.printToPDF

重构了 webContents.printToPDF 以与 Chromium headless 实现对齐。 更多信息请见 #33654

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

终止对 18.x.y 的支持

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

E18 (2022年3月)E19 (2022年5月)E20 (2022年8月)E21 (2022年9月)E22 (2022年12月)
18.x.y19.x.y20.x.y21.x.y22.x.y
17.x.y18.x.y19.x.y20.x.y21.x.y
16.x.y17.x.y18.x.y19.x.y20.x.y

接下来

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

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

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

Electron 20.0.0

· 阅读时间:约 5 分钟

Electron 20.0.0 已发布! 它包括升级到 Chromium 104, V8 10.4, 和 Node.js 16.15.0。 请阅读下文了解更多详情!


Electron 团队很高兴发布了 Electron 20.0.0! 您可以通过 npm install electron@latest 进行安装,或者从我们的 发布网站 下载它。 继续阅读有关此版本的详细信息,并请分享您的任何反馈!

重要变化

新特性

  • 在 Windows 上添加了沉浸式暗黑模式。 #34549
  • 添加支持类似面板的行为。 窗口可以浮动在全屏应用上。 #34665
  • 更新了 Windows 控件覆盖按钮,使其在 Windows 11 上的外观和感觉更加原生。 #34888
  • 现在开始,渲染器在默认情况下会被沙盒化,除非指定了 nodeIntegration: truesandbox: false#35125
  • 添加了使用 nan 构建原生模块时的保护措施。 #35160

Stack Changes

破坏性 & API 更改

以下是 Electron 20 中引入的破坏性变化。 有关这些和未来变化的更多信息可在 计划的突破性变化 页面找到。

默认值被更改:默认情况下,渲染器不为 nodeIntegration: true 将进行沙盒处理

之前, 指定预加载脚本的渲染器默认不启用沙盒。 这意味着默认情况下,预加载脚本可以访问Node.js。 在 Electron 20中,此默认值将被更改。 从Electron 20开始,渲染器 默认情况下会被沙盒化,除非指定了 nodeIntegration: truesandbox: false

如果预加载脚本不依赖于 Node,则无需执行任何操作。 如果 preload 脚本依赖于 Node,请重构代码,或从渲染器中删除 Node 用法 ,或者显式指定相关渲染器 sandbox: false

修复:nan原生模块自发崩溃的问题

在 Electron 20 中,我们更改了两个与原生模块相关的项目:

  1. V8 headers 现在默认使用 c++17 。 这个标志已添加到 electron-rebuild 了。
  2. 我们修复了一个问题,即一个缺失的 include 导致依赖于 nan 的原生模块自发崩溃。

为了获得最大的稳定性,我们建议在重新构建原生模块时使用 node-gyp >= 8.4.0 和 electron-rebuild >= 3.2.9,特别是依赖于nan的模块。 有关更多信息,请参阅 electron #35160 和 node-gyp #2497

已删除:Linux 上的 .skipTaskbar

在 X11上, skipTaskbar 向 X11 窗口管理器发送一条 _NET_WM_STATE_SKIP_TASKBAR 消息。 Wayland 没有与其一致的功能,并且已知的 变通办法具有不可接受的理由(如,在 GNOME 中 Window.is_skip_taskbar 需要不安全模式),因此 Electron 无法在 Linux 上支持此功能。

终止对 17.x.y 的支持

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

E18 (3月22日)E19 (5月22日)E20 (8月22日)E21 (2022年9月)E22 (2022年12月)
18.x.y19.x.y20.x.y21.x.y22.x.y
17.x.y18.x.y19.x.y20.x.y21.x.y
16.x.y17.x.y18.x.y19.x.y20.x.y
15.x.y--------

下一步做什么

在短期内,你可以期待我们的团队继续专注于跟上构成 Electron 的主要组件的发展,包括 Chromium、Node 和 V8。 虽然我们谨慎地不对发布日期做出承诺,但我们的计划是大约每2个月发布一次带有新版本组件的主要版本的 Electron。

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

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

Electron 19.0.0

· 阅读时间:约 4 分钟

Electron 19.0.0 已发布! 它包括升级到 Chromium 102, V8 10.2, 和 Node.js 16.14.2。 请阅读下文了解更多详情!


Electron 团队很高兴发布了 Electron 19.0.0! 您可以通过 npm install electron@latest 进行安装,或者从我们的 发布网站 下载它。 继续阅读有关此版本的详细信息,并请分享您的任何反馈!

重要变化

Electron 发布时间变更

该项目正在恢复其支持最新三个主要版本的早期政策。 查看我们的版本文档 以了解更多关于 Electron 版本控制和支持的详细信息。 暂时有四个主要版本,以帮助用户适应从 Electron 15 开始的新版本发布节奏。 您可以在此处阅读 完整详细信息

更改栈

破坏性 & API 更改

以下是 Electron 19 中引入的破坏性变化。 有关这些和未来变化的更多信息可在 计划的破坏性变化 页面找到。

在 Linux 上不受支持: .skipTaskbar

BrowserWindow constructor 选项 skipTaskbar 在 Linux 上不再支持。 在 #33226 中更改

已移除 WebPreferences.preloadURL

半文档化的 preloadURL 属性已从 Web 首选项中删除。 #33228. 使用 WebPreferences.preload 代替。

终止对 15.x.y 和 16.x.y 的支持

Electron 14.x.y 和 15.x.y 都已终止支持。 该博客文章 使 Electron 恢复到其支持最新三个主要版本的 早期政策 。 鼓励开发人员和应用程序升级到较新版本的 Electron。

E15 (9月21日)E16 (11月21日)E17 (2月22日)E18 (3月22日)E19 (5月22日)
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--

下一步做什么

在短期内,您可以期望该团队继续专注于跟上构成 Electron 的主要组件的开发,包括 Chromium,Node 和 V8。 虽然我们谨慎地不对发布日期做出承诺,但我们的计划是大约每2个月发布一次带有新版本组件的主要版本的 Electron。

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

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

Electron 18.0.0

· 阅读时间:约 5 分钟

Electron 18.0.0 已发布! 它包括升级到 Chromium 100, V8 10.0, 和 Node.js 16.13.2。 请阅读下文了解更多详情!


Electron 团队很高兴发布了 Electron 18.0.0.0! 您可以通过 npm install electron@latest 进行安装,或者从我们的 发布网站 下载它。 继续阅读有关此版本的详细信息,并请分享您的任何反馈!

值得注意的变化

Electron 发布时间变更

从 Electron 15 开始,Electron 将每 8 周发布一个新的主要稳定版本。 您可以在此处阅读 完整详细信息

此外,Electron 将会改变支持的版本,从最新的三个版本改为最新的四个版本,直到 2022 年 5 月。 关于 Electron 版本的更多详细信息,请看我们的 版本管理文档 2022 年 5 月以后,我们将回到支持最新的三个版本。

Stack 更改

主要特性

  • 增加 ses.setCodeCachePath() API,用于设置代码缓存目录。 #33286
  • 移除了基于旧的 BrowserWindowProxywindow.open 实现。 这也删除了 webPreferences 中的 nativeWindowOpen 选项。 #29405
  • WebContents 中增加了 'focus' 和 'blur' 事件。 #25873
  • 在 MacOS 上添加了替换菜单角色:showSubstitutions``toggleSmartQuotes``toggleSmartDashes``toggleTextReplacement #32024
  • Added a first-instance-ack event to the app.requestSingleInstanceLock() flow, allowing users to seamlessly transmit data from the first instance to the second instance. #31460
  • setBackgroundColor 中增加了更多颜色的支持。 #33364

有关新功能和变更的完整列表,请参阅 18.0.0 发布通知

破坏性 & API 更改

以下是 Electron 18 中引入的突破性变化。 有关这些和未来变化的更多信息可在 计划的突破性变化 页面找到。

已移除: nativeWindowOpen

在 Electron 15之前, window.open 默认使用 BrowserWindowProxy。 这意味着 window.open('about:blank') 无法打开可同步编写脚本的子窗口,以及有其他不兼容之处。 自 Electron 15 起, nativeWindowOpen 将默认启用。

有关更多详细信息,请参阅 Electron 中的 window.open 文档。 删除此功能的 PR: #29405

终止对 14.x.y 的支持

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

从 Electron 15 开始,我们已经将支持的版本从最新的三个版本改为最新的四个版本,直到 2022 年 5 月的 Electron 19。 在 Electron 19 之后,我们将回归到支持最新的三个版本。 此版本支持变化是我们新的节奏变化的一部分。 请参阅 我们的博客文章 ,了解的完整详细信息。

E15 (9 月 21 号)E16 (11 月 21 号)E17 (2 月 22 号)E18 (3 月 22 号)E19 (5 月 22 号)
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--

接下来

在短期内,你可以期待我们的团队继续专注于跟上构成 Electron 的主要组件的发展,包括 Chromium、Node 和 V8。 尽管我们很谨慎,不对发布日期作出承诺,但我们的计划是大约每两个月发布一次 Electron 的主要版本和这些组件的新版本。

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

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

Electron 17.0.0

· 阅读时间:约 4 分钟

Electron 17.0.0 已发布! 它包括升级到 Chromium 98, V8 9.8, 和 Node.js 16.13.0。 请阅读下文了解更多详情!


Electron 团队很高兴发布了 Electron 17.0.0.0! 您可以通过 npm install electron@later 进行安装,或者从我们的 发布网站 下载它。 继续阅读有关此版本的详细信息,并请分享您的任何反馈!

重要变化

Electron 发布时间变更

从 Electron 15 开始,Electron 将每 8 周发布一个新的主要稳定版本。 您可以在此处阅读 完整详细信息

此外,Electron 将会改变支持的版本,从最新的三个版本改为最新的四个版本,直到 2022 年 5 月。 关于 Electron 版本的更多详细信息,请看我们的 版本管理文档 2022 年 5 月以后,我们将回到支持最新的三个版本。

架构(Stack)更新

主要特性

  • Added webContents.getMediaSourceId(), can be used with getUserMedia to get a stream for a WebContents. #31204
  • Deprecates webContents.getPrinters() and introduces webContents.getPrintersAsync(). #31023
  • desktopCapturer.getSources is now only available in the main process. #30720

有关新功能和变更的完整列表,请参阅 17.0.0 发布通知

重大更改

以下是 Electron 17 中引入的破坏性变更。 有关这些和未来变化的更多信息可在 计划的突破性变化 页面找到。

desktopCapturer.getSources in the renderer

The desktopCapturer.getSources API is now only available in the main process. This has been changed in order to improve the default security of Electron apps.

API 更改

There were no API changes in Electron 17.

Removed/Deprecated Changes

  • Usage of the desktopCapturer.getSources API in the renderer has been removed. See here for details on how to replace this API in your app.

终止对 13.x.y 的支持

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

从 Electron 15 开始,我们已经将支持的版本从最新的三个版本改为最新的四个版本,直到 2022 年 5 月的 Electron 19。 在 Electron 19 之后,我们将回归到支持最新的三个版本。 此版本支持变化是我们新的节奏变化的一部分。 请参阅 我们的博客文章 ,了解的完整详细信息。

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

接下来

在短期内,您可以期待团队继续专注于跟上构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。 虽然我们谨慎地不对发布日期做出承诺,但我们的计划是大约每2个月发布一次带有新版本组件的主要版本的 Electron。

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

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

Electron 16.0.0

· 阅读时间:约 5 分钟

Electron 16.0.0 已发布! 它包括升级到 Chromium 96, V8 9.6, 和 Node.js 16.9.1。 请阅读下文了解更多详情!


Electron 团队很高兴发布了 Electron 16.0.0.0! 您可以通过 npm install electron@later 进行安装,或者从我们的 发布网站 下载它。 继续阅读有关此版本的详细信息,并请分享您的任何反馈!

重要变化

Electron 发布时间变更

从 Electron 15 开始,Electron 将每 8 周发布一个新的主要稳定版本。 您可以在此处阅读 完整详细信息

此外,Electron 将会改变支持的版本,从最新的三个版本改为最新的四个版本,直到 2022 年 5 月。 关于 Electron 版本的更多详细信息,请看我们的 版本管理文档 2022 年 5 月以后,我们将回到支持最新的三个版本。

架构(Stack)更新

主要特性

  • Now supports the WebHID API. #30213
  • Add data parameter to app.requestSingleInstanceLock to share data between instances. #30891
  • Pass securityOrigin to media permissions request handler. #31357
  • Add commandLine.removeSwitch. #30933

有关新功能和变更的完整列表,请参阅 16.0.0 发布通知

重大更改

以下是 Electron 16 中引入的破坏性变更。 有关这些和未来变化的更多信息可在 计划的突破性变化 页面找到。

Building Native Modules

If your project uses node-gyp to build native modules, you may need to call it with --force-process-config depending on your project's setup and your Electron version. More information about this change can be found at #2497.

行为改变:crashReporter 实现切换到 Linux 上的 Crashpad

The underlying implementation of the crashReporter API on Linux has changed from Breakpad to Crashpad, bringing it in line with Windows and Mac. As a result of this, child processes are now automatically monitored, and calling process.crashReporter.start in Node child processes is no longer needed (and is not advisable, as it will start a second instance of the Crashpad reporter).

There are also some subtle changes to how annotations will be reported on Linux, including that long values will no longer be split between annotations appended with __1, __2 and so on, and instead will be truncated at the (new, longer) annotation value limit.

API 更改

There were no API changes in Electron 16.

Removed/Deprecated Changes

  • Usage of the desktopCapturer.getSources API in the renderer has been deprecated and will be removed. This change improves the default security of Electron apps. See here for details on how to replace this API in your app.

终止对 12.x.y 的支持

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

从 Electron 15 开始,我们已经将支持的版本从最新的三个版本改为最新的四个版本,直到 2022 年 5 月的 Electron 19。 在 Electron 19 之后,我们将回归到支持最新的三个版本。 此版本支持变化是我们新的节奏变化的一部分。 请参阅 我们的博客文章 ,了解的完整详细信息。

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

接下来

在短期内,您可以期待团队继续专注于跟上构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。 虽然我们谨慎地不对发布日期做出承诺,但我们的计划是大约每2个月发布一次带有新版本组件的主要版本的 Electron。

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

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

Electron 15.0.0

· 阅读时间:约 6 分钟

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


Electron 团队很高兴发布了 Electron 15.0.0.0! 您可以通过 npm install electron@later 进行安装,或者从我们的 发布网站 下载它。 继续阅读有关此版本的详细信息,并请分享您的任何反馈!

重要变化

Electron 发布时间变更

从 Electron 15 开始,Electron 将每隔8周发布一个新的主要稳定版本。 您可以在此处阅读 完整详细信息

此外,Electron 将在 2022 年 5 月之前,将支持的版本从最新的三个版本更改为最新的四个版本。 查看我们的版本文档以了解更多关于 Electron 版本的详细信息。

架构(Stack)更新

Highlight Features

  • nativeWindowOpen: true 不再是实验性的,现在是默认设置。
  • 新增了 safeStorage 字符串加密 API。 #30430
  • WebContents 新增 'frame-created' 事件,该事件在页面中创建帧时发出。 #30801
  • BrowserWindowwill-resize 事件添加了用以调整窗口大小的 edge 信息。 #29199

有关新功能和变更的完整列表,请参阅 15.0.0 发布通知

重大更改

以下是 Electron 15 中引入的突破性变化。 有关这些和未来变化的更多信息可在 计划的突破性变化 页面找到。

默认值更改:nativeWindowOpen 默认设为 true

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

有关更多详细信息,请参阅 Electron 中 window.open 的文档。

API 更改

  • WebContents 新增 'frame-created' 事件,该事件在页面中创建帧时发出。 #30801
  • 新增了 safeStorage 字符串加密 API。 #30430
  • dialog.showMessageBox 新增了 signal 选项。 #26102
  • 加入 Electron Fuse,用于在应用程序加载的 app.asar 文件上强制执行代码签名。 要求最新的 asar 模块(v3.1.0 或更高版本)。 #30900
  • 加入 fuses 以在打包好的应用里,禁用 NODE_OPTIONS--inspect 调试参数。 #30420
  • 新增 MenuItem.userAccelerator 属性以读取用户分配的 macOS 快捷键的覆盖。 #26682
  • 新增 app.runningUnderARM64Translation 属性以检测在 Rosetta 在 Apple Silicon 或 WOW 在 Windows 上运行 ARM 时的情况。 #29168
  • 添加新的 imageAnimationPolicy Web 首选项来控制图像的动画方式。 #29095
  • 增加支持通过 context bridge 发送 Blob。 #29247

Removed/Deprecated Changes

没有 API 被删除或废弃。

支持版

此外,Electron 将在 2022 年 5 月之前,将支持的版本从最新的三个版本更改为最新的四个版本。 在 Electron 19 之后,我们将回归到支持最新的三个版本。 此版本支持变化是我们新的节奏变化的一部分。 请参阅 我们的博客文章 ,了解的完整详细信息。

鼓励开发者和应用程序升级到 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--

接下来

短期内, 您可以期待团队继续专注于跟上 Electron 主要组件的开发工作。 包括 Chromium, Node 和 V8。 尽管我们谨慎地避免对发布日期做出承诺,但我们的计划是大约每季度发布一次 Electron 的新主要版本以及这些组件的新版本。

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

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

Electron 14.0.0

· 阅读时间:约 7 分钟

Electron 14.0.0 已发布! 它包括了到 Chromium 93 和 V8 9.3 的更新。 我们添加了多个 API 更新、错误修复和一般改进。 请阅读下文了解更多详情!


Electron 团队很高兴发布了 Electron 14.0.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!

重要变化

Electron 发布时间变更

Beginning in September 2021 with Electron 15, Electron will release a new major stable version every 8 weeks. 您可以在此处阅读 完整详细信息。 Electron 15 will begin beta on September 1, 2021 and stable release will be on September 21, 2021. 您可以在此处找到 Electron 的公开时间表。 Additionally, Electron will be changing supported versions from latest three versions to latest four versions until May 2022. See see our versioning document for more detailed information about versioning in Electron.

架构(Stack)更新

Highlight Features

  • Default Changed: nativeWindowOpen now defaults to true. (see docs)
  • Child windows no longer inherit BrowserWindow construction options from their parents. #28550
  • Added new session.storagePath API to get the path on disk for session-specific data. #28665
  • Added process.contextId used by @electron/remote. #28007
  • Added experimental cookie encryption support behind an Electron Fuse. #29492

有关新功能和变更的完整列表,请参阅 14.0.0 发布通知

重大更改

以下是 Electron 14 中引入的破坏性变更。 More information about these and future changes can be found on the Planned Breaking Changes page.

已移除: app.allowRendererProcessReuse

The app.allowRendererProcessReuse property has been removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability.

更多信息见:#18397

移除: Browser Window Affinity

The affinity option when constructing a new BrowserWindow has been removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability.

更多信息见:#18397

API 更改: window.open()

The optional parameter frameName no longer sets the title of the window. This behavior now follows the specification described by the native documentation for the windowName parameter.

If you were using this parameter to set the title of a window, you can instead use the win.setTitle(title) method.

已移除: worldSafeExecuteJavaScript

worldSafeExecuteJavaScript has been removed with no alternative. Please ensure your code works with this property enabled. It has been enabled by default since Electron 12.

若您使用了 webFrame.executeJavaScriptwebFrame.executeJavaScriptInIsolatedWorld,这个改动会对您造成影响。 您将需要确保这些方法中任何一种返回的值都被 Context Bridge API 支持,因为这些方法使用相同的值传递语意。

默认更改: nativeWindowOpen 默认为 true

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

更多详细信息: window.open

移除: 从父窗口继承的 BrowserWindowConstructorOptions

在Electron 14之前,使用 window.open 打开的窗口将继承 BrowserWindow构造函数选项,例如 transparentresizable ,这些选项来自其父窗口 。 Beginning with Electron 14, this behavior has been removed and windows will not inherit any BrowserWindow constructor options from their parents.

相反,请使用 setWindowOpenHandler显式设置新窗口的选项:

webContents.setWindowOpenHandler((details) => {
return {
action: 'allow',
overrideBrowserWindowOptions: {
// ...
},
};
});

已移除: additionalFeatures

WebContents 的 new-windowdid-create-window 事件中已弃用的 additionalFeatures 属性已被删除。 由于 new-window 使用 positional 参数,因此该参数仍然存在,但始终 空数组 []。 (Note: the new-window event itself is already deprecated and has been replaced by setWindowOpenHandler.) 窗口功能中的 Bare keys 现在会显示为选项对象中值为 true 的 key。

// 在 Electron 14 移除
// Triggered by window.open('...', '', 'my-key')
webContents.on('did-create-window', (window, details) => {
if (details.additionalFeatures.includes('my-key')) {
// ...
}
});

// Replace with
webContents.on('did-create-window', (window, details) => {
if (details.options['my-key']) {
// ...
}
});

移除: remote 模块

Deprecated in Electron 12, the remote module has now been removed from Electron itself and extracted into a separate package, @electron/remote. The @electron/remote module bridges JavaScript objects from the main process to the renderer process. This lets you access main-process-only objects as if they were available in the renderer process. This is a direct replacement for the remote module. See the module's readme for migration instructions and reference.

API 更改

  • Added BrowserWindow.isFocusable() method to determine whether a window is focusable. #28642
  • Added WebFrameMain.visibilityState instance property. #28706
  • Added disposition, referrer and postBody to the details object passed to the window open handler registered with setWindowOpenHandler. #28518
  • Added process.contextId used by @electron/remote. #28007
  • Added experimental cookie encryption support behind an Electron Fuse. #29492
  • Added missing resourceType conversions for webRequest listener details: font, ping, cspReport, media, webSocket. #30050
  • Added new session.storagePath API to get the path on disk for session-specific data. #28665
  • Added support for Windows Control Overlay on macOS. #29986
  • Added support for directing Chromium logging to a file with --log-file=.../path/to/file.log. Also, it's now possible to enable logging from JavaScript by appending command-line switches during the first JS tick. #29963
  • Added support for the des-ede3 cipher in node crypto. #27897
  • Added a ContextBridgeMutability feature that allows context bridge objects to be mutated. #27348

Removed/Deprecated Changes

The following APIs have been removed or are now deprecated:

  • The remote module has been removed after being deprecated in Electron 12. #25734
  • Child windows no longer inherit BrowserWindow construction options from their parents. #28550
  • Removed deprecated additionalFeatures property from new-window and did-create-window WebContents events. #28548
  • Removed the deprecated app.allowRendererProcessReuse and BrowserWindow affinity options. #26874
  • The submitURL option for crashReporter.start is no longer a required argument when uploadToServer is false. #28105

终止对 11.x.y 的支持

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

接下来

在短期内,您可以期待团队继续专注于跟上构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。 尽管我们谨慎地避免对发布日期做出承诺,但我们的计划是大约每季度发布一次 Electron 的新主要版本以及这些组件的新版本。

For information on planned breaking changes in upcoming versions of Electron, see our Planned Breaking Changes.

Electron 版本发布新步伐

· 阅读时间:约 9 分钟

从2021年9月开始,Electron将每8周发布一个新的主要稳定版本。


2019年,Electron 改为12周的发布周期,以匹配 Chromium 的6周发布周期。 最近,Chrome 和 Microsoft 都发生了一些变化,使得我们重新考虑更改 Electron 目前的发布频率:

  1. Chromium 计划从2021年9月21日的 Chrome 94 开始每4周发布一个新的里程碑。此版本节奏还每8周添加新的"扩展稳定"选项,其中包含所有更新的安全修补程序。

  2. 微软应用商店要求 基于Chromium应用的版本号不得低于最新发行版本2个版本号。 例如,如果最新发布的Chromium主版本号为85,任何基于Chromium的应用其所用版本必须为83或更高。 以上规则包含Electron应用。

从2021年9月开始,Electron将每8周发布一个新的主要稳定版本,以匹配Chromium的8周扩展稳定版本。

我们的第一个发行版Electron 15将会随Chromium扩展稳定版在2021年9月21日释出。

需要注意的是,版本发行频率的改变会影响下游应用程序的开发,我们想让我们的开发者社区尽快知晓此次改变。 请阅读我们的2021开发计划以获取更多详情。

Electron 15:临时 Alpha 内测版本

基于我们的Electron15初始版本针对的是Chromium的非扩展稳定版(其扩展稳定版基于偶数版本号),我们需要改变我们的初始目标发行日期。 然而,一款Electron的app必须使用最近两个版本以内的Chromium以便能被微软商店收录,这项新规定会使得等待两个新版本变得不可持续。

伴随着这两项要求,我们的团队也面临着时间规划上的挑战。 推进Electron 15以包括Chromium的M94版本会使得应用开发者们能快速获取最新的Chromium扩展稳定版;然而这也会使得公测版到稳定版的开发周期缩短到只有3周。

为了有利于此次变动,Electron将会提供一个临时的内测版本,并仅限于Electron 15系列的发行版。 本内测版将给与开发者们更多时间,用这款比每日版更稳定的版本去测试和规划他们的Eletron15。

Electron 15系列内测版本频道将会于2021年7月21日开通。 It will transition to a beta release on September 1st, 2021 with a stable release target of September 21st, 2021. 在那之后的Electron发行版将不再包含内测系列。

2021 发行计划

以下是我们当前的2021发行计划:

ElectronChromeAlpha 版本Beta 版本Stable 版Stable 发布周期(周数)
E13M91-2021年3月5日2021年5月25日12
E14M93-2021年5月26日2021年8月31日14
E15M942021年7月20日2021年9月01日2021年9月21日9周(包含 alpha 版本)
E16M96-2021年9月22日2021年11月16日8
E17M98-2021年11月17日2022年2月1日11

添加 alpha 通道将 Electron 15 发布前的开发时间从 3 周延长到 9 周 - 更接近我们新的 8 周周期,同时仍满足 Windows 应用商店提交的要求。

为了进一步帮助应用程序开发人员, 从2021年的剩余时间到2022年5月,我们还将把我们支持的版本政策从最新的3个版本扩展到最新的4个版本的Electron。 这意味着即使您无法立即更改升级计划,旧版本的Electron仍将收到安全更新和修复程序。

解决疑虑

在安排此发布周期更改之前,我们发布这篇文章是有原因的。 我们知道,更快的发布周期将对Electron应用程序产生真正的影响 - 其中一些应用程序可能已经认为我们的主要发布节奏过于频繁。

我们试图解决以下常见问题:

❓ 为什么要做这样的改变? 为什么不保持12周的发布节奏呢?

为了在Electron中提供最新版本的Chromium,我们的发布计划需要跟踪他们的版本。 有关Chromium发布周期的更多信息可以在这里找到

此外,目前12周的发布节奏将无法满足Microsoft应用商店的新提交要求。 即使是最新稳定版本的Electron上的应用程序也会经历大约两周的时间,他们的应用程序根据新的安全要求可能会被拒绝。

每个新的 Chromium 版本都包含新的功能,错误修复/安全修复和V8 改进。 作为应用程序开发人员,我们希望你们及时做出这些更改,所以我们的稳定版本日期将继续与其他Chromium稳定版本保持一致。 作为应用程序开发人员,您将比以前更快地获得Chromium和V8的新功能和修复程序。

❓ 现有的12周发布计划已经进展很快。 团队正在采取哪些步骤来简化升级?

更频繁发版的一个好处是发版内容_更少_ 。 我们知道升级Electron的主版本可能是困难的。 我们希望较小的版本将减少每个版本中 Chromium和Node 重大更改,以及更少的破坏性改动。

❓ 未来的 Electron 版本会提供 alpha 版本吗?

目前没有支持永久性的 Alpha 版本的计划。 此 Alpha 仅适用于 Electron 15,作为帮助开发人员在较短的发布周期内更轻松升级的一种方式。

❓ Electron 会扩展支持的版本数量吗?

随着 Electron 19 的发布,我们将支持的版本政策从 Electron 的最新三个版本扩展到最新的四个版本直到 2022 年 5 月。 在 Electron 19 发布后,我们将返回 支持最新的三个主版本,以及 beta 和 nightly 版本。

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

问题?

📨 您有任何问题或疑虑,请发送邮件至 info@electronjs.org加入我们的Discord。 我们知道这是一个将影响许多应用程序和开发者的变化,您的反馈对我们非常重要。 我们希望收到您的来信!