Zum Hauptteil springen

Electron 9.0.0

· Die Lesezeit beträgt 4 min

Electron 9.0.0 wurde veröffentlicht! Es enthält Upgrades auf Chromium 83, V8 8.3und Node.js 12.14. Wir haben einige neue API-Integrationen für unsere Rechtschreibprüfung, den aktivierten PDF-Viewer und vieles mehr hinzugefügt!


Das Electron Team freut sich über die Veröffentlichung von Electron 9.0.0! Sie können es mit npm über npm install electron@latest installieren oder von unserer Release-Website herunterladen. Der Release ist voll mit Upgrades, Korrekturen und neuen Features. Wir können nicht warten, was du mit ihnen baust! Lesen Sie weiter für Details zu dieser Version und teilen Sie bitte Ihr Feedback!

Bemerkenswerte Änderungen

Stack-Änderungen

Hervorgehobene Features

  • Mehrere Verbesserungen der Rechtschreibprüfungs-Funktion. Weitere Details finden Sie in #22128 und #22368.
  • Verbesserte Fenster-Event-Handler Effizienz unter Linux. #23260.
  • PDF-Viewer aktivieren. #22131.

Eine vollständige Liste der neuen Funktionen und Änderungen finden Sie in den 9.0.0 Versionshinweisen.

Breaking Changes

  • Veraltet-Warnung bei Verwendung von remote ohne enableRemoteModule: true. #21546
    • Dies ist der erste Schritt in unseren Plänen für die Entfernung des remote Moduls und der Wechsel zu userland. You can read and follow this issue that details our reasons for this and includes a proposed timeline for deprecation.
  • Standardmäßig app.enableRendererProcessReuse auf true gesetzt. #22336
    • This is continued work for a future requirement that native Node modules loaded in the renderer process be either N-API or Context Aware. Vollständige Informationen und vorgeschlagene Zeitleiste sind in diesem Issue beschrieben.
  • Das Senden von nicht-JavaScript-Objekten über IPC wirft nun eine Exception aus. #21560
    • Dieses Verhalten wurde in Electron 8.0 veraltet. In Electron 9.0, the old serialization algorithm has been removed, and sending such non-serializable objects will now throw an "object could not be cloned" error.

Weitere Informationen zu diesen und zukünftigen Änderungen finden Sie auf der geplante Änderungen Seite.

API-Änderungen

  • shell API-Änderungen:
    • The shell.openItem API has been replaced with an asynchronous shell.openPath API. proposal
  • sessionAPI changes:
    • Added session.listWordsFromSpellCheckerDictionary API to list custom words in the dictionary. #22128
    • Added session.removeWordFromSpellCheckerDictionary API to remove custom words in the dictionary. #22368
    • Added session.serviceWorkerContext API to access basic service worker info and receive console logs from service workers. #22313
  • app API-Änderungen:
    • Added a new force parameter to app.focus() on macOS to allow apps to forcefully take focus. #23447
  • BrowserWindow API-Änderungen:
    • Added support for property access to some getter/setter pairs on BrowserWindow. #23208

Veraltete APIs

Die folgenden APIs sind jetzt veraltet oder entfernt:

  • shell.openItem API is now depreciated, and replaced with an asynchronous shell.openPath API.
  • <webview>.getWebContents, which was deprecated in Electron 8.0, is now removed.
  • webFrame.setLayoutZoomLevelLimits, which was deprecated in Electron 8.0, is now removed.

Ende der Unterstützung für 6.x.y

Electron 6.x.y hat das Ende des Supports gemäß der Unterstützungsrichtlinien erreicht. Developers and applications are encouraged to upgrade to a newer version of Electron.

What's Next

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. Der vorläufige 10.0.0 Zeitplan legt Schlüsseldaten im Electron 10.0 Entwicklungsszyklus fest. 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.

Ändern Sie die Voreinstellung von contextIsolation von false auf true (Start in Electron 10)

Without contextIsolation, any code running in a renderer process can quite easily reach into Electron internals or an app's preload script. That code can then perform privileged actions that Electron wants to keep restricted.

Changing this default improves the default security of Electron apps, so that apps will need to deliberately opt in to the insecure behaviour. Electron will depreciate the current default of contextIsolation in Electron 10.0, and change to the new default (true) in Electron 12.0.

For more information on contextIsolation, how to enable it easily and it's security benefits please see our dedicated Context Isolation Document.