Aller au contenu principal

Electron 42

· 7 mins de lecture

Electron 42 est disponible! It includes upgrades to Chromium 148.0.7778.96, V8 14.8, and Node v24.15.0.


The Electron team is excited to announce the release of Electron 42! Vous pouvez l'installer avec npm via npm install electron@latest ou le télécharger sur notre site web de téléchargement de version. Vous obtiendrez plus de détails sur cette version en lisant ce qui suit.

If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Les bogues et les demandes de fonctionnalités peuvent être signalés dans l'[outil de suivi des problèmes] d’Electron (https://github.com/electron/electron/issues).

Changements notables

macOS notifications now use UNNotification API

Electron has migrated from the deprecated NSUserNotification API to the UNNotification API on macOS. La nouvelle API nécessite qu'une application soit signée par code pour que les notifications soient affichées. #47817

Additionally, Electron 42 adds Notification.getHistory() for macOS (#51123), and id and groupId options to the Notification constructor to allow custom identifiers and visual grouping in Notification Center (#50304).

electron no longer downloads itself via postinstall script

Previously, the electron npm package would download the Electron binary from the repository's GitHub Releases in the package's postinstall script. With recent supply chain security attacks against the npm ecosystem with postinstall scripts as a common attack vector, Electron will now download itself dynamically the first time that its main bin script is run (e.g. via npx electron). With this change, you can now use Electron with the npm --ignore-scripts flag. See RFC #22 for more context. #49328

Si vous avez besoin de télécharger le binaire Electron à la demande, vous pouvez maintenant appeler le script install-electron :

npm install electron --save-dev --ignore-scripts
npx install-electron

WebAuthn Touch ID support on macOS

Added app.configureWebAuthn({ touchID: { keychainAccessGroup } }) to enable the WebAuthn Touch ID platform authenticator on macOS. This also introduces a select-webauthn-account session event for discoverable-credential selection. #51411

Afficher les animations et le flou d'arrière-plan

Ajout de la fonctionnalité d'animation à view.setBounds() et ajout de view.setBackgroundBlur(), permettant des transitions plus fluides de l'interface utilisateur et des effets de flou natifs d'arrière-plan. #48812

Changements de la Stack

Electron 42 met à jour Chromium de 146.0.7680.65 à 148.0.7778.96, Node.js de v24.14.0 à v24.15.0, et V8 de 14.6 à 14.8.

Nouvelles fonctionnalités et améliorations

  • Added app.configureWebAuthn({ touchID: { keychainAccessGroup } }) to enable the WebAuthn Touch ID platform authenticator on macOS. introduit également l'événement de session select-webauthn-account pour la sélection des identifiants découvrables. #51411 (Also in 41)
  • Ajout du privilège allowExtensions pour protocol.registerSchemesAsPrivileged() afin d'activer les extensions Chrome sur les protocoles personnalisés. #49951
  • Ajout de Notification.getHistory() pour macOS. #51123
  • Added Notification.handleActivation(callback) API on Windows to handle notification clicks, replies, and action buttons — including when the app is launched from a notification (cold start). #49919
  • Added ELECTRON_INSTALL_PLATFORM and ELECTRON_INSTALL_ARCH variables to install binaries from other platforms and architectures. #49981
  • Added app.isActive() to check if the app is the active/foreground application (macOS only). #49622
  • Added globalShortcut.setSuspended() and globalShortcut.isSuspended() methods to temporarily suspend and resume global shortcut handling. #50777
  • Added id and groupId options to the notification constructor on macOS for custom identifiers and visual grouping in Notification Center. #50304
  • Ajout du support de id, groupId, et groupTitle pour les notifications Windows. #50895
  • Added nativeTheme.shouldDifferentiateWithoutColor on macOS. #50409 (Also in 41)
  • Ajout de la fonctionnalité d'animation à view.setBounds() et ajout de view.setBackgroundBlur(). #48812
  • Added support for heap profiling in contentTracing. #51162 (Also in 41)
  • Added support for importing shared textures using the nv16 pixel format. #51187
  • Added support for importing shared textures using the p010le 10-bit YUV pixel format. #49272
  • Added support for several more safeStorage backends via new asynchronous functionality in safeStorage. #49054
  • Added support for the urgency option in notifications on Windows. #50383 (Also in 41)
  • Ajout de la possibilité de capturer la trace de la pile JS sur le moteur de rendu OOM. #50911
  • Electron télécharge maintenant dynamiquement son binaire dans node_modules au premier lancement au lieu d'exécuter un script postinstall. Ajout du script install-electron pour déclencher manuellement le téléchargement. #49328
  • Enabled wasm trap handlers behind WasmTrapHandlers fuse. #48983 (Also in 41)
  • Remplacement de NSUserNotification déprécié par des notifications d'utilisateurs. #47817

Changements majeurs avec rupture de compatibilité

Behavior Changed: macOS notifications now use UNNotification API

Electron has migrated from the deprecated NSUserNotification API to the UNNotification API on macOS. La nouvelle API nécessite qu'une application soit signée par code pour que les notifications soient affichées. #47817

Behavior Changed: electron no longer downloads itself via postinstall script

Previously, the electron npm package would download the Electron binary from the repository's GitHub Releases in the package's postinstall script. With recent supply chain security attacks against the npm ecosystem with postinstall scripts as a common attack vector, Electron will now download itself dynamically the first time that its main bin script is run (e.g. via npx electron). See RFC #22 for more context. #49328

Behavior Changed: Offscreen rendering default device scale factor

Previously, OSR used the primary display's device scale factor for rendering. Starting from Electron 42, the default changes to a constant value of 1.0 for more consistent output sizes. Use webPreferences.offscreen.deviceScaleFactor to specify a custom value. #49683

Suppression de quota type syncable dans session.clearStorageData(options)

When calling Session.clearStorageData(options), the options.quotas object is no longer supported because it has been removed from upstream Chromium.

Suppression de la variable d'environnement ELECTRON_SKIP_BINARY_DOWNLOAD

Cette variable d'environnement n'est plus supportée en raison du nouveau comportement de téléchargement différé. #50459

Obsolète: Passer seulement un tableau hslShift à nativeImage.createFromNamedImage()

Passer seulement un tableau hslShift à nativeImage.createFromNamedImage() est déprécié. You should now pass an options object with an hslShift property instead:

// Deprecated
nativeImage.createFromNamedImage(imageName, [0, 1, -1]);
// Replace with
nativeImage.createFromNamedImage(imageName, {
hslShift: [0, 1, -1],
});

Fin du support pour 39.x.y

Electron 39.x.y a atteint sa fin de support conformément à la politique de support du projet. Nous encourageons les développeurs à mettre à jour vers une version plus récente d'Electron et de faire de même avec leurs applications. See https://releases.electronjs.org/schedule to see the timeline for supported versions of Electron.

Et maintenant ?

À court terme, vous pouvez compter sur l’équipe pour continuer a se concentrer sur le développement des principaux composants qui composent Electron, notamment Chromium, Node et V8.

You can find Electron's public timeline here.

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