Skip to main content

Electron 10.0.0

· 9 min read

Electron 10.0.0 已发布!它包括对 Chromium 85、V8 8.5 和 Node.js 12.16 的升级。我们添加了几个新的 API 集成和改进。阅读以下内容了解更多详情!

🌐 Electron 10.0.0 has been released! It includes upgrades to Chromium 85, V8 8.5, and Node.js 12.16. We've added several new API integrations and improvements. Read below for more details!


Electron 团队很高兴地宣布 Electron 10.0.0 已发布!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的 发布网站 下载。此次发布包含了大量升级、修复和新功能。

🌐 The Electron team is excited to announce the release of Electron 10.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. The release is packed with upgrades, fixes, and new features.

在 Electron 10 版本中,我们还对发布说明进行了更改。为了更容易区分 Electron 10 中的全新内容以及 Electron 10 与以前版本之间的变化,我们现在还会包含那些引入到 Electron 10 但已经回移到以前版本的更改。我们希望这能让应用在升级 Electron 时更容易找到新功能和修复的漏洞。

🌐 In the Electron 10 release, we also made a change to our release notes. To make it easier to tell what's brand new in Electron 10 and what may have changed between Electron 10 and past releases, we now also include changes that were introduced to Electron 10, but backported to previous releases. We hope this makes it easier to apps to find new features and bug fixes when upgrading Electron.

我们迫不及待想看看你们用它们能够创造出什么!继续阅读以了解此次发布的详细信息,并请分享你们的任何反馈!

🌐 We can't wait to see what you build with them! Continue reading for details about this release, and please share any feedback you have!

显著变化

🌐 Notable Changes

  • 添加了 contents.getBackgroundThrottling() 方法和 contents.backgroundThrottling 属性。 [#21036]
  • 在主进程中暴露了 desktopCapturer 模块。#23548
  • 现在可以通过调用 ses.isPersistent() API 来检查给定的 session 是否是持久的。 #22622
  • 解决由于网络 IP 地址更改和 ICE 导致 RTC 通话无法连接的网络问题。(Chromium 问题 1113227)。#24998

请查看 10.0.0 版本说明 以获取完整的新功能和更改列表。

🌐 See the 10.0.0 release notes for a full list of new features and changes.

Electron 成为 OpenJS 基金会影响力项目

· 3 min read

在今天早上的 OpenJS World 上,我们宣布 Electron 已正式从 OpenJS Foundation 的孵化计划毕业,现在成为了 OpenJS Foundation 的影响力项目。

🌐 At OpenJS World this morning, we announced that Electron has officially graduated from the OpenJS Foundation's incubation program, and is now an OpenJS Foundation Impact Project.

Electron 于 2019 年 12 月进入孵化阶段,在蒙特利尔举行的最后一次 OpenJS Foundation 全球大会上。作为一个影响力项目,我们很高兴在 JavaScript 社区中发挥更大的作用,并继续与 OpenJS Foundation 合作。

🌐 Electron entered incubation in December of 2019, at the last OpenJS Foundation global conference in Montreal. We're excited to take a larger role in the JavaScript community as an Impact Project, and continue our partnership with the OpenJS Foundation.


了解更多

🌐 Learning more

你可以在 OpenJSF 网站 上了解该基金会、其使命以及成员情况。OpenJS 基金会是多个开源 JavaScript 项目的主办方,包括 jQuery、Node.js 和 webpack。它得到了 30 个企业和终端用户成员的支持,包括 GoDaddy、Google、IBM、Intel、Joyent 和 Microsoft。

🌐 You can read up on the foundation, its mission, and its members on the OpenJSF website. The OpenJS Foundation is host to a number of open source JavaScript projects including jQuery, Node.js, and webpack. It's supported by 30 corporate and end-user members, including GoDaddy, Google, IBM, Intel, Joyent, and Microsoft.

Electron 是一个使用网页技术构建跨平台桌面应用的开源框架。想了解更多关于 Electron 背后的人以及他们如何协作的信息,请查看我们的治理页面

🌐 Electron is an open–source framework for building cross-platform desktop applications with web technologies. To learn more about the humans behind Electron and how they work together, take a look at our Governance page.

要开始使用 Electron 本身,请查看我们的文档

🌐 To get started with Electron itself, take a peek at our documentation.

谷歌文档季

· 5 min read

Electron 很荣幸能够参与 Google 第二届“文档季”计划,该计划将来自开源组织的导师与技术文档撰写者配对,以改进项目文档。

🌐 Electron is proud to be participating in the second edition of Google's Season of Docs initiative, which pairs mentors from open source organizations with technical writers to improve project documentation.


什么是 Season of Docs?

🌐 What is Season of Docs?

Season of Docs logo

Season of Docs 是一个促进技术文档撰写者与开源社区之间协作的项目,旨在让双方受益。开源维护者利用文档撰写者的技术写作专长来改进其文档的结构和内容,而技术文档撰写者则在导师的指导下加入开源社区。你可以在 Google 的 Season of Docs 网站 上了解更多信息。

🌐 Season of Docs is a program that fosters collaboration between technical writers and open source communities to the benefit of both parties. Open source maintainers utilize the writer's technical writing expertise to improve the structure and content of their documentation, while the technical writer is introduced to an open-source community under the guidance of its mentors. Learn more about it on the Google's Season of Docs website.

这是我们首次参与该计划,我们将指导一名技术写作人员,他将与 Electron 的 Ecosystem Working Group 一起工作,重塑我们文档的大部分内容。你可以在这里了解整个项目的时间表 here

🌐 For our first time participating in the program, we'll be mentoring a single technical writer who will be working alongside Electron's Ecosystem Working Group to reshape large parts of our documentation. You can learn more about the timeline of the whole project here.

如何注册?

🌐 How do I sign up?

你有兴趣作为技术写作与我们合作吗?首先,请先了解谷歌今年项目的技术写作指南,并查看我们准备的两个项目创意草稿

🌐 Are you interested in collaborating with us as a technical writer? First, get familiar with Google's tech writer guide for this year's program, and check out the two project idea drafts that we have prepared.

想要被选为 Electron 文档季的技术作家,候选人需要在 6 月 8 日至 7 月 9 日的技术作家申请阶段,在 Google 文档季网站上提交申请。

🌐 In order to be selected as Electron's technical writer for Season of Docs, candidates will need to apply on the Google Season of Docs website during the Technical Writer Application phase that is running from June 8 to July 9..

你的申请应包括一份提案,这是一份书面文件,详细描述你计划在三个月内在 Electron 文档上实现的内容。这份提案可以基于我们的项目创意文档中提到的某个起始点,也可以是全新的内容。不知道从哪里开始?你可以查看去年的被接受提案名单以获得灵感。

🌐 Your application should include a proposal, which is a written document that describes in detail what you plan to achieve on the Electron docs over the course of 3 months. This proposal can either develop on one of the starting points mentioned in our Project Idea doc, or can be something entirely new. Don't know where to start? You can check out last year's list of accepted proposals for inspiration.

除了提案之外,我们还会审查你作为技术写作人员的背景。请附上你的简历,重点突出相关的写作经验,同时提供技术写作样本(这些样本可以是现有文档、教程、博客文章等)。

🌐 Aside from the proposal, we'll also be looking at your background as a technical writer. Please include a copy of your resume with an emphasis on relevant writing experience, as well as technical writing samples (these samples could be existing documentation, tutorial, blog posts, etc.)

如果你想讨论项目提案,给我们发邮件至 season-of-docs@electronjs.org,我们可以从那里开始交流!

🌐 If you want to discuss project proposals, shoot us an email at season-of-docs@electronjs.org and we can chat from there!

参考

🌐 References

Electron 9.0.0

· 8 min read

Electron 9.0.0 已经发布!它包括对 Chromium 83、V8 8.3 和 Node.js 12.14 的升级。我们为拼写检查器功能添加了几个新的 API 集成,启用了 PDF 查看器功能,还有更多更新!

🌐 Electron 9.0.0 has been released! It includes upgrades to Chromium 83, V8 8.3, and Node.js 12.14. We've added several new API integrations for our spellchecker feature, enabled PDF viewer, and much more!


Electron 团队很高兴地宣布 Electron 9.0.0 正式发布!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。本次发布包含了大量升级、修复和新功能。我们迫不及待想看看你会用它们创造出什么作品!继续阅读以了解本次发布的详细信息,并请分享你的任何反馈!

🌐 The Electron team is excited to announce the release of Electron 9.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. The release is packed with upgrades, fixes, and new features. We can't wait to see what you build with them! Continue reading for details about this release, and please share any feedback you have!

显著变化

🌐 Notable Changes

  • 拼写检查功能的多项改进。更多详情请参见 #22128#22368
  • 提高了 Linux 上窗口事件处理器的效率。#23260
  • 启用 PDF 查看器。 #22131

请查看 9.0.0 版本说明 以获取完整的新功能和更改列表。

🌐 See the 9.0.0 release notes for a full list of new features and changes.

即将发布的 Electron 版本

· 2 min read

Electron 暂时停止主要版本发布

🌐 Electron is temporarily pausing major releases


发生了什么?

🌐 What's Happening?

我们的主要版本发布节奏计划与 Chromium 的节奏保持同步,而 Chromium 项目最近决定由于工作计划调整而暂停其发布。这意味着在 Chromium 调整节奏的期间,Electron 也将暂时暂停新的主要版本发布。

🌐 Our major release cadence schedule moves in lockstep with that of Chromium, and the Chromium project has made the recent decision to pause its releases due to adjusted work schedules. This means that for the duration of Chromium's altered cadence, Electron will also temporarily pause new major releases.

我们认为我们的最佳选择是追随 Chromium 的脚步,因此在此期间,Electron 团队将转而全职致力于错误修复、安全性、性能和稳定性。

🌐 We feel that our best choice is to follow in Chromium's footsteps, and so in the interim the Electron team will shift to full-time work on bugfixes, security, performance, and stability.

我们希望确保维护人员和用户的福祉在此期间得到优先考虑,因此我们欢迎你的反馈,并期待恢复正常的发布计划。

🌐 We want to ensure that both our maintainers and our consumers' wellbeing is prioritized during this time, so we welcome your feedback and look forward to returning to our regular release schedule.

欲获取更多更新,请关注我们的推特账号

🌐 For more updates, please follow our Twitter account.

编辑(2020-03-30):Electron 9 稳定版将以 Chromium M83 为目标,并计划于 2020 年 5 月 19 日发布,以回应 Chromium 的公告 关于跳过 M82 稳定版日期并调整 M83 稳定版日期的通知。

🌐 Edit (2020-03-30): Electron 9 stable will target Chromium M83 and be released on May 19, 2020, in response to Chromium's announcement of skipping the M82 stable date and adjusting the M83 stable date.

Electron 8.0.0

· 10 min read

Electron 8.0.0 已经发布!它包括对 Chromium 80、V8 8.0 和 Node.js 12.13.0 的升级。我们还添加了 Chrome 内置的拼写检查功能,以及更多其他功能!

🌐 Electron 8.0.0 has been released! It includes upgrades to Chromium 80, V8 8.0, and Node.js 12.13.0. We've added Chrome's built-in spellchecker, and much more!


Electron 团队很高兴地宣布 Electron 8.0.0 正式发布!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。本次发布包含了大量升级、修复和新功能。我们迫不及待想看看你会用它们创造出什么作品!继续阅读以了解本次发布的详细信息,并请分享你的任何反馈!

🌐 The Electron team is excited to announce the release of Electron 8.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. The release is packed with upgrades, fixes, and new features. We can't wait to see what you build with them! Continue reading for details about this release, and please share any feedback you have!

显著变化

🌐 Notable Changes

  • 已实现使用 Chrome 内置拼写检查功能。更多详情请参见 #20692#21266
  • IPC 通信现在使用 v8 的结构化克隆算法。这比现有逻辑更快、功能更多且更少意外,对于大型缓冲区和复杂对象带来了约 2 倍的性能提升。小消息的延迟没有显著影响。更多详情请参见 #20214

请查看8.0.0版本说明以获取新功能和更改的完整列表。

🌐 See the 8.0.0 release notes for a full list of new features and changes.

Electron 加入了 OpenJS 基金会

· 4 min read

在蒙特利尔举行的Node+JS Interactive大会上,OpenJS 基金会宣布已将 Electron 纳入基金会的孵化计划。基金会致力于通过提供一个中立的组织来托管和维持项目,以及共同资助有利于整个社区的活动,从而支持 JavaScript 生态系统和 web 技术的健康发展。

🌐 At Node+JS Interactive in Montreal, the OpenJS Foundation announced that it accepted Electron into the Foundation's incubation program. The Foundation is committed to supporting the healthy growth of the JavaScript ecosystem and web technologies by providing a neutral organization to host and sustain projects, as well as collaboratively fund activities for the benefit of the community at large.

OpenJS 基金会托管了多个开源 JavaScript 项目,包括 jQuery、Node.js 和 webpack。它由 30 个公司和终端用户成员支持,包括 GoDaddy、Google、IBM、Intel、Joyent 和 Microsoft。Electron 是一个开源框架,用于使用 Web 技术构建跨平台桌面应用。

🌐 The OpenJS Foundation is host to a number of open source JavaScript projects including jQuery, Node.js, and webpack. It's supported by 30 corporate and end-user members, including GoDaddy, Google, IBM, Intel, Joyent, and Microsoft. Electron is an open–source framework for building cross-platform desktop applications with web technologies.

这对 Electron 来说是一个激动人心的举措,我们将其视为我们作为开源项目发展的下一步。

🌐 This is an exciting move for Electron, and we see it as a next step in our evolution as an open-source project.


这对开发者意味着什么

🌐 What this means for developers

Electron 加入 OpenJS 基金会并不会改变 Electron 的制作、发布或使用方式——也不会直接影响使用 Electron 开发应用的开发者。尽管 Electron 最初是在 2013 年由 GitHub 创建的,但目前由许多组织和个人维护。2019 年,Electron 对其治理结构进行了规范,并大力投入于正式化涉及整个项目的决策制定进程。我们相信,有多家组织和开发者对 Electron 进行投资和协作会使项目更强大。

🌐 Electron joining the OpenJS Foundation does not change how Electron is made, released, or used — and does not directly affect developers building applications with Electron. Even though Electron was originally created at GitHub in 2013, it is currently maintained by a number of organizations and individuals. In 2019, Electron codified its governance structure and invested heavily into formalizing how decisions affecting the entire project are made. We believe that having multiple organizations and developers investing in and collaborating on Electron makes the project stronger.

随着我们开源项目日渐成熟,将 Electron 从单一企业实体所有提升到一个专注于支持 Web 和 JavaScript 生态系统的中立基金会是理所当然的下一步。

🌐 Lifting Electron up from being owned by a single corporate entity and moving it into a neutral foundation focused on supporting the web and JavaScript ecosystem is a natural next step as we mature as an open-source project.

了解更多

🌐 Learning more

你可以在 OpenJSF 网站 上了解基金会、其使命及成员。有关 Electron 被纳入 OpenJSF 孵化计划的更多信息和相关报道,请查看官方新闻稿。想了解更多关于 Electron 背后的人以及他们如何合作的信息,请访问我们的 治理页面

🌐 You can read up on the foundation, its mission, and its members on the OpenJSF website. For more information and quotes about the acceptance of Electron into the OpenJSF incubation program, check out the official press release. To learn more about the humans behind Electron and how they work together, take a look at our Governance page.

要开始使用 Electron 本身,请查看我们的文档

🌐 To get started with Electron itself, take a peek at our documentation.

Chromium WebAudio 漏洞修复 (CVE-2019-13720)

· 3 min read

Chrome 中发现了一个高危漏洞,该漏洞会影响所有基于 Chromium 的软件,包括 Electron。

🌐 A High severity vulnerability has been discovered in Chrome which affects all software based on Chromium, including Electron.

此漏洞已被分配编号 CVE-2019-13720。你可以在 Chrome 博客文章 中了解更多相关信息。

🌐 This vulnerability has been assigned CVE-2019-13720. You can read more about it in the Chrome Blog Post.

请注意,Chrome 已报告此漏洞正在被广泛利用,因此强烈建议你尽快升级 Electron。

🌐 Please note that Chrome has reports of this vulnerability being used in the wild so it is strongly recommended you upgrade Electron as soon as possible.


范围

🌐 Scope

这会影响任何可能运行第三方或不受信任的 JavaScript 的 Electron 应用。

🌐 This affects any Electron application that may run third-party or untrusted JavaScript.

缓解措施

🌐 Mitigation

受影响的应用应升级到 Electron 的修补版本。

🌐 Affected apps should upgrade to a patched version of Electron.

我们已发布 Electron 的新版本,其中包含针对此漏洞的修复:

🌐 We've published new versions of Electron which include fixes for this vulnerability:

Electron 7.0.1 在公告发布之前就自动包含了上游的修复。Electron 8 同样不受影响。Electron 5 中不存在该漏洞,因此该版本也不受影响。

🌐 Electron 7.0.1 automatically included the fix from upstream, before the announcement was made. Electron 8 is similarly unaffected. The vulnerability did not exist in Electron 5, so that version is also unaffected.

更多信息

🌐 Further Information

此漏洞由卡巴斯基实验室的安东·伊万诺夫和阿列克谢·库拉耶夫发现,并已向 Chrome 团队报告。Chrome 博客文章可以在 这里 找到。

🌐 This vulnerability was discovered by Anton Ivanov and Alexey Kulaev at Kaspersky Labs and reported to the Chrome team. The Chrome blog post can be found here.

要了解有关保持你的 Electron 应用安全的最佳做法的更多信息,请参阅我们的[安全教程]。

🌐 To learn more about best practices for keeping your Electron apps secure, see our security tutorial.

如果你希望报告 Electron 中的漏洞,请提交 [GitHub 安全咨询]。

🌐 Please file a GitHub Security Advisory if you wish to report a vulnerability in Electron.

Electron 7.0.0

· 6 min read

Electron 7.0.0 已发布!它包括对 Chromium 78、V8 7.8 和 Node.js 12.8.1 的升级。我们新增了适用于 Arm 64 的窗口版本、更快的 IPC 方法、新的 nativeTheme API,以及更多功能!

🌐 Electron 7.0.0 has been released! It includes upgrades to Chromium 78, V8 7.8, and Node.js 12.8.1. We've added a Window on Arm 64 release, faster IPC methods, a new nativeTheme API, and much more!


Electron 团队很高兴地宣布 Electron 7.0.0 正式发布!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。本次发布包含了大量升级、修复和新功能。我们迫不及待想看看你会用它们构建什么作品!继续阅读以了解本次发布的详细信息,并请分享你的任何反馈!

🌐 The Electron team is excited to announce the release of Electron 7.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. The release is packed with upgrades, fixes, and new features. We can't wait to see what you build with them! Continue reading for details about this release, and please share any feedback you have!

显著变化

🌐 Notable Changes

  • 堆栈升级:

    StackVersion in Electron 6Version in Electron 7What's New
    Chromium76.0.3809.14678.0.3905.177, 78
    V87.67.87.7, 7.8
    Node.js12.4.012.8.112.5, 12.6, 12.7, 12.8, 12.8.1
  • 新增 Windows on Arm(64 位)版本发布。#18591#20112

  • 已添加 ipcRenderer.invoke()ipcMain.handle() 用于异步请求/响应式 IPC。强烈推荐使用它们,而不是 remote 模块。有关更多信息,请参阅这篇博客文章“Electron 的 ‘remote’ 模块被认为有害”。#18449

  • 添加了 nativeTheme API,用于读取并响应操作系统主题和配色方案的变化。#19758, #20486

  • 已切换到新的 TypeScript 定义 生成器。生成的定义更加精确;因此,如果你的 TypeScript 构建失败,这很可能是原因。 #18103

请参阅7.0.0 发布说明以获取更完整的更改列表。

🌐 See the 7.0.0 release notes for a longer list of changes.

重大变化

🌐 Breaking Changes

有关这些和未来更改的更多信息,请参阅计划中的重大更改页面。

🌐 More information about these and future changes can be found on the Planned Breaking Changes page.

  • 移除已弃用的 API:
    • 基于回调的函数版本,现在使用了 Promise。 #17907
    • Tray.setHighlightMode()(macOS)。#18981
    • app.enableMixedSandbox() #17894
    • app.getApplicationMenu(),
    • app.setApplicationMenu(),
    • powerMonitor.querySystemIdleState(),
    • powerMonitor.querySystemIdleTime(),
    • webFrame.setIsolatedWorldContentSecurityPolicy(),
    • webFrame.setIsolatedWorldHumanReadableName(),
    • webFrame.setIsolatedWorldSecurityOrigin() #18159
  • Session.clearAuthCache() 不再允许筛选已清除的缓存条目。 #17970
  • macOS 上的原生界面(菜单、对话框等)现在会自动匹配用户机器的夜间模式设置。#19226
  • 已更新 electron 模块以使用 @electron/get。现在支持的最低 Node 版本为 Node 8。#18413
  • 文件 electron.asar 不再存在。任何依赖其存在的打包脚本都应更新。 #18577

4.x.y 停止支持

🌐 End of Support for 4.x.y

根据该项目的支持政策,Electron 4.x.y 已停止支持。建议开发者和应用升级到更新版本的 Electron。

🌐 Electron 4.x.y has reached end-of-support as per the project's support policy. Developers and applications are encouraged to upgrade to a newer version of Electron.

应用反馈计划

🌐 App Feedback Program

我们继续使用我们的应用反馈计划进行测试。参与该计划的项目会在他们的应用上测试 Electron 测试版;作为回报,他们发现的新问题会被优先处理并纳入稳定版发布。如果你想参与或了解更多信息,请查看我们关于该计划的博客文章

🌐 We continue to use our App Feedback Program for testing. Projects who participate in this program test Electron betas on their apps; and in return, the new bugs they find are prioritized for the stable release. If you'd like to participate or learn more, check out our blog post about the program.

下一步计划

🌐 What's Next

在短期内,你可以预期团队将继续专注于跟进构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。虽然我们小心翼翼地避免对发布日期作出承诺,但我们的计划是大约每季度发布一次包含这些组件新版本的 Electron 主要版本。临时 8.0.0 时间表列出了 Electron 8 开发生命周期中的关键日期。此外,请参阅我们的版本控制文档以获取关于 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. The tentative 8.0.0 schedule maps out key dates in the Electron 8 development life cycle. Also, see our versioning document for more detailed information about versioning in Electron.

有关即将发布的 Electron 版本中计划的重大更改的信息,请参阅我们的计划重大更改文档

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

Electron 6.0.0

· 10 min read

Electron 团队很高兴地宣布 Electron 6.0.0 正式发布!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。本次发布包含了大量升级、修复和新功能。我们迫不及待想看看你会用它们构建什么!继续阅读以了解本次发布的详细信息,并请分享你任何的反馈!

🌐 The Electron team is excited to announce the release of Electron 6.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. The release is packed with upgrades, fixes, and new features. We can't wait to see what you build with them! Continue reading for details about this release, and please share any feedback you have!


新功能

🌐 What's New

今天对 Electron 项目来说是一个里程碑:这是我们第一次在与对应的 Chrome 稳定版本 同一天 发布稳定的 Electron 版本!🎉

🌐 Today marks a first for the Electron project: this is the first time we've made a stable Electron release on the same day as the corresponding Chrome stable release! 🎉

Electron 的大部分功能由 Chromium、Node.js 和 V8 的核心组件提供。Electron 会跟进这些项目的最新进展,为用户提供新的 JavaScript 功能、性能改进和安全修复。在 Electron 6 中,这些软件包中的每一个都有一次主要版本更新:

🌐 Much of Electron's functionality is provided by the core components of Chromium, Node.js, and V8. Electron keeps up-to-date with these projects to provide our users with new JavaScript features, performance improvements, and security fixes. Each of these packages has a major version bump in Electron 6:

此版本还包括对 Electron API 的改进。发行说明 提供了更完整的列表,但以下是主要亮点:

🌐 This release also includes improvements to Electron's APIs. The release notes have a more complete list, but here are the highlights:

Promisification

Electron 6.0 继续了在 5.0 中启动的现代化计划,以改进对Promise的支持。

🌐 Electron 6.0 continues the modernization initiative started in 5.0 to improve Promise support.

这些函数现在返回 Promises,并且仍然支持旧版基于回调的调用:

🌐 These functions now return Promises and still support older callback-based invocation:

  • contentTracing.getCategories() #16583
  • contentTracing.getCategories() #16583
  • contentTracing.getTraceBufferUsage() #16600
  • contents.executeJavaScript() #17312
  • cookies.flushStore() #16464
  • cookies.get() #16464
  • cookies.remove() #16464
  • cookies.set() #16464
  • dialog.showCertificateTrustDialog() #17181
  • inAppPurchase.getProducts() #17355
  • inAppPurchase.purchaseProduct()#17355
  • netLog.stopLogging() #16862
  • session.clearAuthCache() #17259
  • session.clearCache() #17185
  • session.clearHostResolverCache() #17229
  • session.clearStorageData() #17249
  • session.getBlobData() #17303
  • session.getCacheSize() #17185
  • session.resolveProxy() #17222
  • session.setProxy() #17222
  • webContents.hasServiceWorker() #16535
  • webContents.printToPDF() #16795
  • webContents.savePage() #16742
  • webFrame.executeJavaScript() #17312
  • webFrame.executeJavaScriptInIsolatedWorld() #17312
  • webviewTag.executeJavaScript() #17312

这些函数现在有两种形式:同步和基于 Promise 的异步:

🌐 These functions now have two forms, synchronous and Promise-based asynchronous:

  • dialog.showMessageBox()/dialog.showMessageBoxSync() #17298
  • dialog.showOpenDialog()/dialog.showOpenDialogSync() #16973
  • dialog.showSaveDialog()/dialog.showSaveDialogSync() #17054

这些函数现在返回 Promises:

🌐 These functions now return Promises:

Electron Helper (Renderer).appElectron Helper (GPU).appElectron Helper (Plugin).app

🌐 Electron Helper (Renderer).app, Electron Helper (GPU).app and Electron Helper (Plugin).app

为了启用hardened runtime,它会限制可写执行内存以及加载由不同团队 ID 签名的代码,需要向 Helper 授予特殊的代码签名权限。

🌐 In order to enable the hardened runtime, which restricts things like writable-executable memory and loading code signed by a different Team ID, special code signing entitlements needed to be granted to the Helper.

为了将这些权限限制在需要它们的进程类型范围内,Chromium 添加了 三种新的 Helper 应用变体:一种用于渲染器(Electron Helper (Renderer).app)、一种用于 GPU 进程(Electron Helper (GPU).app)以及一种用于插件(Electron Helper (Plugin).app)。

🌐 To keep these entitlements scoped to the process types that require them, Chromium added three new variants of the Helper app: one for renderers (Electron Helper (Renderer).app), one for the GPU process (Electron Helper (GPU).app) and one for plugins (Electron Helper (Plugin).app).

使用 electron-osx-sign 对 Electron 应用进行代码签名的用户不需要对构建逻辑进行任何更改。如果你使用自定义脚本为应用进行代码签名,应确保三个新的辅助应用已正确签名。

🌐 Folks using electron-osx-sign to codesign their Electron app shouldn't have to make any changes to their build logic. If you're codesigning your app with custom scripts, you should ensure that the three new Helper applications are correctly codesigned.

为了正确地使用这些新助手打包你的应用,你需要使用 electron-packager@14.0.4 或更高版本。如果你使用的是 electron-builder,你应该关注 这个问题 来跟踪对这些新助手的支持情况。

🌐 In order to package your application correctly with these new helpers you need to be using electron-packager@14.0.4 or higher. If you are using electron-builder you should follow this issue to track support for these new helpers.

重大变化

🌐 Breaking Changes

  • 此版本开始为未来对在渲染进程中加载的本地 Node 模块要求其必须是 N-APIContext Aware 打下基础。此更改的原因是提高性能、增强安全性以及减少维护工作量。完整细节及拟定时间表请查看 此问题。预计此更改将在 Electron v11 中完成。
  • net.IncomingMessage 头部已经略有更改,以更接近 Node.js 的行为,特别是 set-cookie 的值以及如何处理重复的头部。#17517
  • shell.showItemInFolder() 现在返回 void,并且是一个异步调用。#17121
  • 应用现在必须在使用 app.getPath('log') 之前,通过调用新函数 app.setAppLogPath() 明确设置日志路径。#17841

3.x.y 支持终止

🌐 End of Support for 3.x.y

根据我们的支持政策,3.x.y 已经达到生命周期终点。我们鼓励开发者和应用升级到更新版本的 Electron。

🌐 Per our support policy, 3.x.y has reached end of life. Developers and applications are encouraged to upgrade to a newer version of Electron.

应用反馈计划

🌐 App Feedback Program

我们继续使用我们的应用反馈计划进行测试。参与该计划的项目会在他们的应用上测试 Electron 测试版;作为回报,他们发现的新问题会被优先处理用于正式版本。如果你想参与或了解更多信息,请查看我们关于该计划的博客文章

🌐 We continue to use our App Feedback Program for testing. Projects who participate in this program test Electron betas on their apps; and in return, the new bugs they find are prioritized for the stable release. If you'd like to participate or learn more, check out our blog post about the program.

下一步计划

🌐 What's Next

在短期内,你可以预期团队将继续专注于跟进构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。虽然我们小心翼翼地避免对发布日期作出承诺,但我们的计划是大约每季度发布一次包含这些组件新版本的 Electron 主要版本。临时 7.0.0 时间表列出了 Electron 7 开发生命周期中的关键日期。此外,请参阅我们的版本控制文档以获取关于 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. The tentative 7.0.0 schedule maps out key dates in the Electron 7 development life cycle. Also, see our versioning document for more detailed information about versioning in Electron.

有关即将发布的 Electron 版本中计划的重大更改的信息,请参阅我们的计划重大更改文档

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