Electron 12.0.0
Electron 12.0.0 已发布!它包括对 Chromium 89、V8 8.9 和 Node.js 14.16 的升级。我们对远程模块进行了修改,新增了 contextIsolation 的默认设置,一个新的 webFrameMain API,以及其他一般性改进。请继续阅读以下内容以获取更多详情!
🌐 Electron 12.0.0 has been released! It includes upgrades to Chromium 89, V8 8.9 and Node.js 14.16. We've added changes to the remote module, new defaults for contextIsolation, a new webFrameMain API, and general improvements. Read below for more details!
Electron 团队很高兴地宣布发布 Electron 12.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。继续阅读以了解此版本的详细信息,并请分享你的任何反馈!
🌐 The Electron team is excited to announce the release of Electron 12.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!
技术栈变更
🌐 Stack Changes
- Chromium
89 - Node.js
14.16 - V8
8.9
显著变化
🌐 Notable Changes
- ContextBridge
exposeInMainWorld方法现在可以暴露非对象 API。#26834 - 已从 Node 12 升级到 Node 14。 #23249
- 新增了一个
webFrameMainAPI,用于从主进程访问WebContents实例的子帧。#25464 contextIsolation和worldSafeExecuteJavaScript的默认值现在是true。#27949 #27502
请查看 12.0.0 版本说明 以获取新功能和更改的完整列表。
🌐 See the 12.0.0 release notes for a full list of new features and changes.
重大变化
🌐 Breaking Changes
- 已弃用
remote模块。它已被@electron/remote替代。#25293- 如果你当前正在使用
remote模块,我们已经在这里编写了迁移到@electron/remote的指南。
- 如果你当前正在使用
- 将
contextIsolation的默认值更改为true。#27949 - 将
worldSafeExecuteJavaScript的默认值更改为true。#27502 - 将
crashReporter.start({ compress })的默认值从false改为true。#25288 - 移除了 Flash 支持:Chromium 已经移除了对 Flash 的支持,Electron 12 中也已移除。有关更多详细信息,请参见 Chromium 的 Flash 路线图。
- Chrome 在 x86 上需要 SSE3:Chromium 已经不再支持不满足 SSE3(流式 SIMD 扩展 3)最低要求的旧 x86 CPU。相关支持已被移除。Electron 12 中也移除了此支持。
有关这些和未来更改的更多信息,请参阅计划中的重大更改页面。
🌐 More information about these and future changes can be found on the Planned Breaking Changes page.
API 变更
🌐 API Changes
- 新增
webFrameMainAPI:webFrameMain模块可用于在现有WebContents实例中查找帧。这是现有 webFrame API 的主进程等效功能。关于此新 API 的更多信息,请参见 这里 和我们的 文档。 appAPI 变更:BrowserWindowAPI 变更:contextBridgeAPI 变更:- 允许 ContextBridge
exposeInMainWorld方法暴露非对象的 API。 #26834
- 允许 ContextBridge
displayAPI 变更:- 在
Display对象中添加了displayFrequency属性,以便获取 Windows 上的刷新率信息。#26472
- 在
extensionsAPI 变更:- 已添加对一些
chrome.managementAPI 的支持。 #25098
- 已添加对一些
MenuItemAPI 变更:- 新增支持显示 macOS 共享菜单。 #25629
netAPI 变更:powerMonitorAPI 变更:sessionAPI 变更:- 在
ses.loadExtension()API 中添加了allowFileAccess选项。#27702 - 为
session.setPermissionRequestHandler添加了display-captureAPI。 #27696 - 在
session.setSSLConfig中添加了disabledCipherSuites选项。 #25818 - 已向
session添加extension-loaded、extension-unloaded和extension-ready事件。 #25385 - 添加了
session.setSSLConfig()以允许配置 SSL。 #25461 - 添加了在
session.setProxy()中显式指定direct、auto_detect或system模式的支持。#24937 - 添加了 串行 API 支持。 #25237
- 添加了用于启用/禁用拼写检查器的 API。 #26276
- 在
shellAPI 变更:- 新增了一个异步
shell.trashItem()API,取代了同步shell.moveItemToTrash()。 #25114
- 新增了一个异步
webContentsAPI 变更:webFrameAPI 变更:- 在渲染器中添加了拼写检查 API。#25060
移除/弃用的变更
🌐 Removed/Deprecated Changes
以下 API 已被删除或弃用:
🌐 The following APIs have been removed or are now deprecated:
- 已弃用
remote模块。它已被@electron/remote替代。#25293 - 已移除不推荐使用的
crashReporterAPI。#26709 - 从打包应用的默认“帮助”菜单中移除了指向 Electron 网站的链接。#25831
9.x.y 停止支持
🌐 End of Support for 9.x.y
根据项目的支持政策,Electron 9.x.y 已经结束支持。建议开发者和应用升级到更新版本的 Electron。
🌐 Electron 9.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.
下一步计划
🌐 What's Next
在短期内,你可以预期团队将继续专注于跟上构成 Electron 的主要组件(包括 Chromium、Node 和 V8)的开发。虽然我们谨慎地不对发布日期做出承诺,但我们的计划是大约每季度发布一次包含这些组件新版本的 Electron 主要版本。初步的 13.0.0 计划 列出了 Electron 13.0 开发生命周期中的关键日期。此外,请参阅我们的版本控制文档 以获取关于 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 13.0.0 schedule maps out key dates in the Electron 13.0 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.