跳转到主内容

Electron 8.0.0

· 阅读时间:约 6 分钟

Electron 8.0.0 已发布! 它包括升级到 Chromium 80, V8 8.0, 和 Node.js 12.13.0。 We've added Chrome's built-in spellchecker, and much more!


Electron 团队很高兴发布了 Electron 8.0.0.0! 您可以通过 npm 安装electron@later 或者从我们的 发布网站 下载它。 这次发布包含升级、修复和新功能。 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!

重要变化

架构(Stack)更新

Highlight Features

  • Implemented usage of Chrome's built-in spellchecker feature. See more details in #20692 and #21266.
  • IPC communication now uses v8's Structured Clone Algorithm. This is faster, more featureful, and less surprising than the existing logic, and brings about a 2x performance boost for large buffers and complex objects. Latency for small messages is not significantly affected. See more details in #20214.

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

重大更改

  • Show module name in deprecation warning for context-aware modules. #21952
    • This is continued work for a future requirement that native Node modules loaded in the renderer process be either N-API or Context Aware. Full info and proposed timeline is detailed in this issue.
  • Values sent over IPC are now serialized with Structured Clone Algorithm. #20214
  • Offscreen Rendering is currently disabled due to lack of a maintainer to work on this feature. It broke during the Chromium upgrade and was subsequently disabled. #20772

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

API 更改

  • app API changes:
    • 已添加 app.getApplicationNameForProtocol(url)#20399
    • Added app.showAboutPanel() and app.setAboutPanelOptions(options) support on Windows. #19420
  • BrowserWindow API changes:
    • Updated docs to note that BrowserWindow options hasShadow is available on all platforms #20038
    • Added trafficLightPosition option to BrowserWindow options to allow custom positioning for traffic light buttons. #21781
    • Added accessibleTitle option to BrowserWindow for setting the accessible window title #19698
    • BrowserWindow.fromWebContents() can now return null #19983
    • Added BrowserWindow.getMediaSourceId() and BrowserWindow.moveAbove(mediaSourceId). #18926
    • Added support for will-move event on macOS. #19641
  • Documented previously undocumented crashReporter.getCrashesDirectory(). #20417
  • dialog API changes:
    • Added dontAddToRecent property to dialog.showOpenDialog and dialog.showOpenDialogSync to prevent documents from being added to recent documents on Windows in open dialogs. #19669
    • Added property customization to dialog.showSaveDialog and dialog.showSaveDialogSync. #19672
  • Notification API changes:
    • Added timeoutType option to allow Linux/Windows users to set the type of notification timeout. #20153
    • Added urgency option to set urgency on Linux notifications. #20152
  • session API changes:
    • Updated documentation on session.setProxy(config) and session.setCertificateVerifyProc(proc) to note optional options. #19604
    • Added session.downloadURL(url) to allow to triggering downloads without a BrowserWindow. #19889
    • Added support for HTTP preconnect resource hints via session.preconnect(options) and the preconnect event. #18671
    • Added session.addWordToSpellCheckerDictionary to allow custom words in the dictionary #21297
  • Added option to shell.moveItemToTrash(fullPath[, deleteOnFail]) on macOS to specify what happens when moveItemToTrash fails. #19700
  • systemPreferences API changes:
    • Updated systemPreferences.getColor(color) documentation for macOS. #20611
    • Added screen media type to systemPreferences.getMediaAccessStatus(). #20764
  • Added nativeTheme.themeSource to allow apps to override Chromium and the OS's theme choice. #19960
  • TouchBar API changes:
    • Added accessibilityLabel property to TouchBarButton and TouchBarLabel to improve TouchBarButton/TouchBarLabel accessibility. #20454
    • Updated TouchBar related documentation #19444
  • tray API changes:
    • Added new options to tray.displayBalloon(): iconType, largeIcon, noSound and respectQuietTime. #19544
    • Added tray.removeBalloon(), which removes an already displayed balloon notification. #19547
    • Added tray.focus(), which returns focus to the taskbar notification area. feat: add tray.focus() #19548
  • webContents API changes:
    • Added contents.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture]) to expose executeJavaScriptInIsolatedWorld on the webContents API. #21190
    • Added methods to capture a hidden webContents. #21679
    • Added options to webContents.print([options], [callback]) to enable customization of print page headers and footers. #19688
    • Added ability to inspect specific shared workers via webContents.getAllSharedWorkers() and webContents.inspectSharedWorkerById(workerId). #20389
    • Added the support of fitToPageEnabled and scaleFactor options in WebContents.printToPDF(). #20436
  • Updated webview.printToPDF documentation to indicate return type is now Uint8Array. #20505

Deprecated APIs

The following APIs are now deprecated:

  • Deprecated the nonfunctional visibleOnFullScreen option within BrowserWindow.setVisibleOnAllWorkspaces prior to its removal in the next major release version. #21732
  • Deprecated alternate-selected-control-text on systemPreferences.getColor(color) for macOS. #20611
  • Deprecated setLayoutZoomLevelLimits on webContents, webFrame, and <webview> Tag because Chromium removed this capability. #21296
  • The default value of false for app.allowRendererProcessReuse is now deprecated. #21287
  • Deprecated <webview>.getWebContents() as it depends on the remote module. #20726

终止对 5.x.y 的支持

Electron 5.x.y has reached end-of-support as per the project's support policy. 我们鼓励开发者将应用程序升级到更新的 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.

接下来

在短期内,您可以期待团队继续专注于跟上构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。 尽管我们谨慎地避免对发布日期做出承诺,但我们的计划是大约每季度发布一次 Electron 的新主要版本以及这些组件的新版本。 暂定 9.0.0 时间表 展示了 Electron 9 开发生命周期中的关键日期。 Also, see our versioning document for more detailed information about versioning in Electron.

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

Deprecation of remote Module (Starting in Electron 9)

Due to serious security liabilities, we are beginning plans to deprecate the remote module starting in Electron 9. You can read and follow this issue that details our reasons for this and includes a proposed timeline for deprecation.