Aller au contenu principal

Electron 12.0.0

· 5 mins à lire

Electron 12.0.0 est disponible ! 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. Lisez la suite ci-dessous pour plus de détails !


La team Electron est excitée d'annoncer la sortie de Electron 12.0.0 ! Vous pouvez l'installer via npm install electron@latest ou le télécharger depuis notre site officiel. Continuez de lire pour plus de détails sur cette version, et s'il vous plaît, partagez vos commentaires et remarques !

Changements notables

Changements de la Stack

Highlight Features

  • The ContextBridge exposeInMainWorld method can now expose non-object APIs. #26834
  • Upgraded from Node 12 to Node 14. #23249
  • Added a new webFrameMain API for accessing sub-frames of a WebContents instance from the main process. #25464
  • The default values of contextIsolation and worldSafeExecuteJavaScript are now true. #27949 #27502

Voir les notes de version 12.0.0 pour une liste complète des nouvelles fonctionnalités et des modifications.

Changements de rupture

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

API Changes

  • Added webFrameMain API: The webFrameMain module can be used to look up frames across existing WebContents instances. This is the main process equivalent of the existing webFrame API. More information about this new API can be found here, and in our documentation.
  • app API changes:
    • Added non-localized serviceName to 'child-process-gone' / app.getAppMetrics(). #25975
    • Added new app.runningUnderRosettaTranslation property to detect when running under rosetta on Apple silicon. #26444
    • Added exitCode to render-process-gone details (app & webContents). #27677
  • BrowserWindow API changes:
    • Ajout de l'API BrowserWindow.isTabletMode(). #25209
    • Added resized (Windows/macOS) and moved (Windows) events to BrowserWindow. #26216
    • Added new system-context-menu event to allow preventing and overriding the system context menu. #25795
    • Added win.setTopBrowserView() so that BrowserViews can be raised. #27713
    • Added webPreferences.preferredSizeMode to allow sizing views according to their document's minimum size. #25874
  • contextBridge API changes:
    • Allowed ContextBridge exposeInMainWorld method to expose non-object APIs. #26834
  • display API changes:
    • Added displayFrequency property to the Display object to allow getting information about the refresh rate on Windows. #26472
  • extensions API changes:
    • Added support for some chrome.management APIs. #25098
  • MenuItem API changes:
    • Ajout de la prise en charge de l'affichage du menu de partage macOS. #25629
  • net API changes:
    • Ajout d'une nouvelle option credentials pour net.request(). #25284
    • Ajout de net.online pour détecter s'il existe actuellement une connexion Internet. #21004
  • powerMonitor API changes:
    • Ajout de powerMonitor.onBatteryPower. #26494
    • Added fast user switching event to powerMonitor on macOS. #25321
  • session API changes:
    • Ajout de l'option allowFileAccess à l'API ses.loadExtension(). #27702
    • Added display-capture API for session.setPermissionRequestHandler. #27696
    • Ajout d'une option disabledCipherSuites à session.setSSLConfig. #25818
    • Added extension-loaded, extension-unloaded, and extension-ready events to session. #25385
    • Added session.setSSLConfig() to allow configuring SSL. #25461
    • Added support for explicitly specifying direct, auto_detect or system modes in session.setProxy(). #24937
    • Added Serial API support. #25237
    • Added APIs to enable/disable spell checker. #26276
  • shell API changes:
    • Added a new asynchronous shell.trashItem() API, replacing the synchronous shell.moveItemToTrash(). #25114
  • webContents API changes:
    • Added a small console hint to console to help debug renderer crashes. #25317
    • Added frame and webContents properties to the details object in webRequest handlers. #27334
    • Added webContents.forcefullyCrashRenderer() to forcefully terminate a renderer process to assist with recovering a hung renderer. #25580
    • Added setWindowOpenHandler API for renderer-created child windows, and deprecate new-window event. #24517
  • webFrame API changes:
    • Added spellcheck API to renderer. #25060

Removed/Deprecated Changes

Les API suivantes ont été supprimées ou sont désormais dépréciées :

  • Déprécié le module remote. It is replaced by @electron/remote. #25293
  • Suppression des API crashReporter dépréciées. #26709
  • Suppression des liens vers le site Web Electron du menu "Aide" par défaut dans les applications packagées. #25831

Fin du support pour 9.x.y

Electron 9.x.y a atteint sa limite pour le support conformément à la politique d'assistance du projetpolitique d'assistance. 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. Le planning escompté de la version 13.0.0 planning défini les dates clés du cycle de vie de développement d'Electron 13.0. 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.