Aller au contenu principal

· 4 mins de lecture

We are excited to announce that Electron has been accepted as a mentoring organization for the 20th edition of Google Summer of Code (GSoC) 2024! Google Summer of Code is a global program focused on bringing new contributors into open source software development.

For more program details, check out Google’s Summer of Code homepage.

About us

Electron is a JavaScript framework for building cross-platform desktop applications using web technologies. The core Electron framework is a compiled binary executable built with Chromium and Node.js, and is mostly written in C++.

Outside of Electron core, we also work on a variety of projects to help sustain the Electron organization, such as:

As a Summer of Code contributor, you would be collaborating with some of Electron’s core contributors on one of many projects under the github.com/electron umbrella.

Before applying

If you aren’t very familiar with Electron, we would recommend you start by reading the documentation and trying out examples in Electron Fiddle.

To learn more about Electron app distribution, you can also play around with Electron Forge by creating a sample application:

npm init electron-app@latest my-app

After familiarizing yourself with the code a bit, come join the conversation on the Electron Discord server.

info

If this is your first time participating in Google Summer of Code or if you’re new to open source in general, we recommend reading Google’s Contributor Guide as a first step before engaging with the community.

Drafting your proposal

Interested in collaborating with Electron? First, check out the seven project idea drafts that we have prepared. Toutes les idées listées sont actuellement ouvertes aux propositions.

Have a different idea you’d like us to consider? We’re also open to accepting new ideas that are not on the proposed project list, but make sure your approach is thoroughly outlined and detailed. When in doubt, we recommend sticking with our listed ideas.

Votre candidature devra inclure :

  • Your proposal: a written document that describes in detail what you plan to achieve over the course of the summer.
  • Votre expérience en tant que développeur. If you have a resume, please include a copy. Otherwise, tell us about your past technical experience.
    • Lack of experience in certain areas won’t disqualify you, but it will help our mentors work out a plan to best support you and make sure your summer project is successful.

A detailed guide of what to submit as part of your Electron application is here. Submit proposals directly to the Google Summer of Code portal. Note that proposals emailed to the Electron team rather than submitted through the application portal will not be considered as a final submission.

If you want more guidance on your proposal or are unsure of what to include, we also recommend that you follow the official Google Summer of Code proposal writing advice here.

Applications open on March 18th, 2024 and close on April 2nd, 2024.

info

Our 2022 Google Summer of Code intern, @aryanshridhar, did an amazing job! If you want to see what Aryan worked on during his summer with Electron, you can read his report in the 2022 GSoC program archives.

Questions?

If you have questions we didn’t address in the blog post or inquiries for your proposal draft, please send us an email at summer-of-code@electronjs.org or check GSoC FAQ!

Ressources

· 4 mins de lecture

Electron 29.0.0 est disponible ! It includes upgrades to Chromium 122.0.6261.39, V8 12.2, and Node.js 20.9.0.


L’équipe Electron est heureuse d’annoncer la sortie d’Electron 29.0.0 ! 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.

Si vous avez des commentaires, veuillez les partager avec nous sur [Twitter] (https\://twitter.com/electronjs) ou Mastodon, ou joignez-vous à notre communauté [Discord] (https\://discord.com/invite/electronjs)! 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

Points clés

  • Added a new top-level webUtils module, a renderer process module that provides a utility layer to interact with Web API objects. The first available API in the module is webUtils.getPathForFile. Electron's previous File.path augmentation was a deviation from web standards; this new API is more in line with current web standards behavior.

Changements de la Stack

Electron 29 upgrades Chromium from 120.0.6099.56 to 122.0.6261.39, Node from 18.18.2 to 20.9.0, and V8 from 12.0 to 12.2.

Nouvelles fonctionnalités

  • Added new webUtils module, a utility layer to interact with Web API objects, to replace File.path augmentation. #38776
  • Added net module to utility process. #40890
  • Added a new Electron Fuse, grantFileProtocolExtraPrivileges, that opts the file:// protocol into more secure and restrictive behaviour that matches Chromium. #40372
  • Added an option in protocol.registerSchemesAsPrivileged to allow V8 code cache in custom schemes. #40544
  • Migrated app.{set|get}LoginItemSettings(settings) to use Apple's new recommended underlying framework on macOS 13.0+. #37244

Changements majeurs avec rupture de compatibilité

Behavior Changed: ipcRenderer can no longer be sent over the contextBridge

Attempting to send the entire ipcRenderer module as an object over the contextBridge will now result in an empty object on the receiving side of the bridge. This change was made to remove / mitigate a security footgun. You should not directly expose ipcRenderer or its methods over the bridge. Instead, provide a safe wrapper like below:

contextBridge.exposeInMainWorld('app', {
onEvent: (cb) => ipcRenderer.on('foo', (e, ...args) => cb(args)),
});

Removed: renderer-process-crashed event on app

The renderer-process-crashed event on app has been removed. Use the new render-process-gone event instead.

// Removed
app.on('renderer-process-crashed', (event, webContents, killed) => {
/* ... */
});

// Replace with
app.on('render-process-gone', (event, webContents, details) => {
/* ... */
});

Removed: crashed event on WebContents and <webview>

The crashed events on WebContents and <webview> have been removed. Use the new render-process-gone event instead.

// Removed
win.webContents.on('crashed', (event, killed) => {
/* ... */
});
webview.addEventListener('crashed', (event) => {
/* ... */
});

// Replace with
win.webContents.on('render-process-gone', (event, details) => {
/* ... */
});
webview.addEventListener('render-process-gone', (event) => {
/* ... */
});

Removed: gpu-process-crashed event on app

The gpu-process-crashed event on app has been removed. Use the new child-process-gone event instead.

// Removed
app.on('gpu-process-crashed', (event, killed) => {
/* ... */
});

// Replace with
app.on('child-process-gone', (event, details) => {
/* ... */
});

Fin du support pour 26.x.y

Electron 26.x.y a atteint la limite pour le support conformément à la politique d'assistance 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.

E29 (Fev'24)E24 (Avr'24)E31 (Jun'24)
29.x.y30.x.y31.x.y
28.x.y29.x.y30.x.y
27.x.y28.x.y29.x.y

Et maintenant ?

Did you know that Electron recently added a community Request for Comments (RFC) process? If you want to add a feature to the framework, RFCs can be a useful tool to start a dialogue with maintainers on its design. You can also see upcoming changes being discussed in the Pull Requests. To learn more, check out our Introducing electron/rfcs blog post, or check out the README of the electron/rfcs repository directly.

À 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.

· 3 mins de lecture

Electron’s API Working Group is adopting an open Requests for Comments (RFC) process to help shepherd larger changes to Electron core.

Why RFCs?

In short, we want to smooth out the process of landing significant changes to Electron core.

Currently, new code changes are mostly discussed through issues and pull requests on GitHub. For most changes to Electron, this is a good system. Many bug fixes, documentation changes, and even new features are straightforward enough to review and merge asynchronously through standard GitHub flows.

For changes that are more significant—for instance, large API surfaces or breaking changes that would affect the majority of Electron apps—it makes sense for review to happen at the ideation stage before most of the code is written.

This process is designed to be open to the public, which will also make it easier for the open source community at large to give feedback on potential changes before they land in Electron.

Comment ça marche ?

The entire RFC process lives in the electron/rfcs repository on GitHub. The steps are described in detail in the repository README.

In brief, an RFC is Proposed once a PR is made to the electron/rfcs repository. A Proposed RFC becomes:

  • Active when the PR is merged into the main branch of the repository, which means that Electron maintainers are amenable to an implementation in electron/electron, or
  • Declined if the PR is ultimately rejected.
info

For the RFC to become Active, the PR must be approved by at least 2 API Working Group members. Before merging, the RFC should be presented synchronously and accepted unanimously by a quorum of at least two-thirds of the WG members. If consensus is reached, a one-month final comment period will be triggered, after which the PR will be merged.

An Active RFC is Completed if the implementation has been merged into electron/electron.

Who can participate?

Anyone in the Electron community can submit RFCs or leave feedback on the electron/rfcs repository!

We wanted to make this process a two-way dialogue and encourage community participation to get a diverse set of opinions from Electron apps that might consume these APIs in the future. If you’re interested in leaving feedback on currently proposed RFCs, the Electron maintainers have already created a few:

Credits

Electron's RFC process was modeled on many established open source RFC processes. Inspiration for many ideas and major portions of copywriting go to:

· 4 mins de lecture

Earlier today, the Electron team was alerted to several public CVEs recently filed against several notable Electron apps. The CVEs are related to two of Electron’s fuses - runAsNode and enableNodeCliInspectArguments - and incorrectly claim that a remote attacker is able to execute arbitrary code via these components if they have not been actively disabled.

We do not believe that these CVEs were filed in good faith. First of all, the statement is incorrect - the configuration does not enable remote code execution. Secondly, companies called out in these CVEs have not been notified despite having bug bounty programs. Lastly, while we do believe that disabling the components in question enhances app security, we do not believe that the CVEs have been filed with the correct severity. “Critical” is reserved for issues of the highest danger, which is certainly not the case here.

Anyone is able to request a CVE. While this is good for the overall health of the software industry, “farming CVEs” to bolster the reputation of a single security researcher is not helpful.

That said, we understand that the mere existence of a CVE with the scary critical severity might lead to end user confusion, so as a project, we’d like to offer guidance and assistance in dealing with the issue.

Comment cela pourrait-il avoir un impact pour moi?

After reviewing the CVEs, the Electron team believes that these CVEs are not critical.

An attacker needs to already be able to execute arbitrary commands on the machine, either by having physical access to the hardware or by having achieved full remote code execution. This bears repeating: The vulnerability described requires an attacker to already have access to the attacked system.

Chrome, for example, does not consider physically-local attacks in their threat model:

We consider these attacks outside Chrome's threat model, because there is no way for Chrome (or any application) to defend against a malicious user who has managed to log into your device as you, or who can run software with the privileges of your operating system user account. Such an attacker can modify executables and DLLs, change environment variables like PATH, change configuration files, read any data your user account owns, email it to themselves, and so on. Such an attacker has total control over your device, and nothing Chrome can do would provide a serious guarantee of defense. This problem is not special to Chrome ­— all applications must trust the physically-local user.

The exploit described in the CVEs allows an attacker to then use the impacted app as a generic Node.js process with inherited TCC permissions. So if the app, for example, has been granted access to the address book, the attacker can run the app as Node.js and execute arbitrary code which will inherit that address book access. This is commonly known as a “living off the land” attack. Attackers usually use PowerShell, Bash, or similar tools to run arbitrary code.

Suis-je impacté?

Par défaut, toutes les versions publiées d'Electron ont les fonctionnalités runAsNode et enableNodeCliInspectArguments activées. If you have not turned them off as described in the Electron Fuses documentation, your app is equally vulnerable to being used as a “living off the land” attack. Again, we need to stress that an attacker needs to already be able to execute code and programs on the victim’s machine.

Atténuation

La façon la plus simple d'atténuer ce problème est de désactiver le fusible runAsNode dans votre application Electron. Le fuse runAsNode acitve ou désactive le respect de la variable d'environnement ELECTRON_RUN_AS_NODE. Please see the Electron Fuses documentation for information on how to toggle theses fuses.

Please note that if this fuse is disabled, then process.fork in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use Utility Processes, which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).

Vous pouvez trouver plus d'informations sur les meilleures pratiques de sécurité que nous recommandons pour les applications Electron dans notre Liste de contrôle de sécurité.

· 4 mins de lecture

Electron 28.0.0 est disponible ! Il inclut des mises à jour vers Chromium 120.0.6099.56, V8 12.0, et Node.js 18.18.2.


L’équipe Electron est heureuse d’annoncer la sortie d’Electron 28.0.0 ! 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.

Si vous avez des commentaires, veuillez les partager avec nous sur [Twitter] (https\://twitter.com/electronjs) ou Mastodon, ou joignez-vous à notre communauté [Discord] (https\://discord.com/invite/electronjs)! 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

Points clés

  • Support implémenté pour les modules ECMAScript ou ESM (Que sont les modules ECMAScript ? en apprendre plus ici. Cela inclut la prise en charge de ESM dans Electron proprement dit, ainsi que certains domaines tels que les points d'entrée de l'API UtilityProcess. Voir notre documentation sur le MES pour plus de détails.
  • En plus de l'activation du support ESM dans Electron, Electron Forge supportera désormais également l'utilisation d'ESM pour empaqueter, compiler et développer des applications Electron. Vous pouvez profiter de ce support dans Forge v7.0.0 et au delà.

Changements de la Stack

Nouvelles fonctionnalités

  • Prise en charge ESM activée. #37535
  • Ajout de points d'entrée ESM à l'API UtilityProcess. #40047
  • Ajout de plusieurs propriétés à l'objet display y compris detected, maximumCursorSize, et nativeOrigin. #40554
  • Ajout du support de la variable d'environnement ELECTRON_OZONE_PLATFORM_HINT sous Linux. #39792

Changements majeurs avec rupture de compatibilité

Comportement modifié : L'affectation à false de WebContents.backgroundThrottling affecte tous les WebContents de la BrowserWindow hote

WebContents.backgroundThrottling défini à false désactivera la limitation des images dans l' BrowserWindow pour tous les WebContents qu'elle affichera.

Supprimé : BrowserWindow.setTrafficLightPosition(position)

BrowserWindow.setTrafficLightPosition(position) a été supprimé, l'API BrowserWindow.setWindowButtonPosition(position) doit être utilisé à loa place qui pprend null à la place de { x: 0, y: 0 } pour réinitialiser la position à celle par défaut du système.

// Supprimé dans Electron 28
win.setTrafficLightPosition({ x: 10, y: 10 })
win.setTrafficLightPosition({ x: 0, y: 0 })

// A remplacer par
win.setWindowButtonPosition({ x: 10, y: 10 })
win.setWindowButtonPosition(null);

Supprimé : BrowserWindow.setTrafficLightPosition(position)

BrowserWindow.getTrafficLightPosition() a été déprécié, l’API BrowserWindow.getWindowButtonPosition() doit être utilisée à la place, celle-ci retourne null au lieu de { x: 0, y: 0 } en absence de position personnalisée.

// Supprimé dans Electron 28
const pos = win.getTrafficLightPosition();
if (pos. === 0 && pos.y === 0) {
// Aucune position personnalisée.
}

// Remplacer par
const ret = win. etWindowButtonPosition();
if (ret === null) {
// Pas de position personnalisée.
}

Supprimé: ipcRenderer.sendTo()

La méthode ipcRenderer.sendTo() a été supprimée. It should be replaced by setting up a MessageChannel between the renderers.

The senderId and senderIsMainFrame properties of IpcRendererEvent have been removed as well.

Supprimé : app.runningUnderRosettaTranslation

The app.runningUnderRosettaTranslation property has been removed. Use app.runningUnderARM64Translation instead.

// Supprimé
console.log(app.runningUnderRosettaTranslation)
// A remplacer par
console.log(app.runningUnderARM64Translation);

Fin du support pour 25.x.y

Electron 25.x.y a atteint la limite pour le support conformément à la politique d'assistance 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.

E28 (Dec'23)E29 (Fev'24)E24 (Avr'24)
28.x.y29.x.y30.x.y
27.x.y28.x.y29.x.y
26.x.y27.x.y28.x.y

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.

· 6 mins de lecture

Réflexion à propos des améliorations et changements intervenu dans l’écosystème des développeurs d’Electron en 2023.


Au cours des derniers mois, nous avons concocté plusieurs changements dans l’écosystème Electron pour booster l’expérience des développeurs pour les applications Electron ! Voici un rapide aperçu des derniers ajouts en direct du siège d’Electron.

Forge Electron 7 et au-delà

Electron Forge 7— nouvelle version majeure de notre outil tout-en-un pour l’empaquetage et la distribution des applications Electron, est maintenant disponible.

Alors que Forge 6 était une réécriture complète de la v5, la v7 a une portée plus réduite, mais contient toujours quelques modifications de rupture. À l’avenir, nous continuerons à publier des versions majeures de Forge car des modifications de rupture doivent être apportées.

Pour plus de détails, consultez la version 7.0.0 de Forge sur GitHub.

Dernières modifications

  • Switched to notarytool for macOS notarization: As of 2023-11-01, Apple sunset the legacy altool for macOS notarization, and this release removes it from Electron Forge entirely.
  • Minimum Node.js increased to v16.4.0: With this release, we’ve set the minimum required Node.js version to 16.4.0.
  • Dropped support for electron-prebuilt and electron-prebuilt-compile: electron-prebuilt was the original name for Electron’s npm module, but was replaced by electron in v1.3.1. electron-prebuilt-compile was an alternative to that binary that came with enhanced DX features, but was eventually abandoned as a project.

Points clés

  • Google Cloud Storage publisher : Dans le cadre de nos efforts pour mieux soutenir la mise à jour automatique statique, Electron Forge prend maintenant en charge la publication directement dans Google Cloud Storage!
  • ESM forge.config.js support: Electron Forge prend désormais en charge les fichiers ESM `forge.config.js. (P.S. Nous attendons avec impatience le support des points d'entrée ESM dans Electron 28. )
  • Les fabricants fonctionnent maintenant en parallèle: Dans Electron Forge 6, les makers s'exécutaient séquentiellement pour ✨ raisons historiques héritées ✨ . Since then, we’ve tested out parallelization for the Make step with no adverse side effects, so you should see a speed-up when building multiple targets for the same platform!
Merci !

🙇 Un grand merci à mahnunchik pour ses contributions au support de GCS Publisher et de l'ESM dans les configurations Forge!

Amélioration des mises à jour automatiques pour stockage statique

Squirrel.Windows and Squirrel.Mac are platform-specific updater technologies that back Electron’s built-in autoUpdater module. Both projects support auto updates via two methods:

  • A Squirrel-compatible update server
  • A manifest URL hosted on a static storage provider (e.g. AWS, Google Cloud Platform, Microsoft Azure, etc.)

The update server method has traditionally been the recommended approach for Electron apps (and provides additional customization of update logic), but it has a major downside—it requires apps to maintain their own server instance if they are closed-source.

On the other hand, the static storage method has always been possible, but was undocumented within Electron and poorly supported across Electron tooling packages.

With some great work from @MarshallOfSound, the update story for serverless automatic app updates has been drastically streamlined:

  • Electron Forge’s Zip and Squirrel.Windows makers can now be configured to output autoUpdater-compatible update manifests.
  • A new major version of update-electron-app (v2.0.0) can now read these generated manifests as an alternative to the update.electronjs.org server.

Once your Makers and Publishers are configured to upload update manifests to cloud file storage, you can enable auto updates with only a few lines of configuration:

const { updateElectronApp, UpdateSourceType } = require('update-electron-app');

updateElectronApp({
updateSource: {
type: UpdateSourceType.StaticStorage,
baseUrl: `https://my-manifest.url/${process.platform}/${process.arch}`,
},
});
Further reading

📦 Want to learn more? For a detailed guide, see Forge’s auto update documentation.

L’univers étendu « @electron/

Au débuts d'Electron, la communauté a publié de nombreux packages pour améliorer l’expérience de développement, d’empaquetage et de distribution d’applications Electron. Au fil du temps, bon nombre de ces paquets ont été incorporés dans l'organisation GitHub d'Electron, l'équipe principale assumant le fardeau de la maintenance.

En 2022, nous avons commencé à unifier tous ces outils sous l’espace de noms « @electron/» sur npm. Ce changement signifie que les paquets qui étaient dans « electron-foo » sont maintenantsur npm dans « @electron/foo » et les dépôts qui étaient nommés « electron/electron-foo » sont maintenant « electron/foo » sur GitHub. Ces changements aident à délimiter clairement les projets initiaux des projets du userland. Cela inclut de nombreux paquets couramment utilisés, tels que:

  • @electron/asar
  • @electron/fuses
  • @electron/get
  • @electron/notarize
  • @electron/osx-sign
  • @electron/packager
  • @electron/rebuild
  • @electron/remote
  • @electron/symbolicate-mac
  • @electron/universal

Going forward, all first-party packages we release will also be in the @electron/ namespace. There are two exceptions to this rule:

  • Electron core will continue to be published under the electron package.
  • Electron Forge will continue to publish all of its monorepo packages under the @electron-forge/ namespace.
Star seeking

⭐ During this process, we also accidentally took the electron/packager repository private, which has the unfortunate side effect of erasing our GitHub star count (over 9000 before the erasure). If you are an active user of Packager, we’d appreciate a ⭐ Star ⭐!

Introduction à @electron/windows-sign

À partir du 2023-06-01, les normes de l’industrie ont commencé à exiger que les clés des certificats de signature de code Windows soient stockées sur du matériel conforme à la FIPS.

En pratique, cela signifie que la signature de code est devenue beaucoup plus compliquée pour les applications qui compilent et signet des environnements d'intégration continue, car de nombreux outils Electron prennent un fichier de certificat et un mot de passe comme paramètres de configuration et tentent de signer à partir de là en utilisant une logique codée en dur.

This situation has been a common pain point for Electron developers, which is why we have been working on a better solution that isolates Windows code signing into its own standalone step, similar to what @electron/osx-sign does on macOS.

In the future, we plan on fully integrating this package into the Electron Forge toolchain, but it currently lives on its own. The package is currently available for installation at npm install --save-dev @electron/windows-sign and can used programmatically or via CLI.

Veuillez si vous le pouvez l’essayer et nous faire part de vos commentaires dans l’outil de suivi des problèmes de repo!

Et ensuite ?

We'll be entering our annual December quiet period next month. While we do, we'll be thinking about how we can make the Electron development experience even better in 2024.

Is there anything you'd like to see us work on next? Signalez-le nous!

· 2 mins de lecture

L'équipe du projet Electron fera une pause pour le mois de décembre 2023 et reviendra gonflée à bloc en janvier 2024.

via GIPHY


Ce qui ne changera pas en Décembre

  1. Les versions zero-day et autres versions majeures liées à la sécurité seront publiées si nécessaire. Les incidents de sécurité doivent être signalés via SECURITY.md.
  2. Les rapports du Code de conduite et la modération se poursuivront normalement.

Ce qui sera différent en Décembre

  1. Electron 28.0.0 sortira le 5 décembre. Pour la suite, il n'y aura pas de nouvelles versions stables avant Janvier.
  2. Pas de sorties Nightly et Alpha pour les deux dernières semaines de décembre.
  3. À quelques exceptions près, il n'y aura pas de ré-éxamen de pull request ni de merge.
  4. Aucune mise à jour de suivi de tickets sur aucun dépôt.
  5. Aucune aide de débogage de la part des mainteneurs sur Discord.
  6. Aucune mise à jour du contenu des réseaux sociaux.

A l'avenir

Nous expérimentons cette période silencieuse depuis maintenant trois ans et l'équilibre entre un mois de repos et le maintien le reste du temps de notre cadence normale de sorties de version nous a plutôt réussi. Nous avons donc décidé d'inclure cette procédure à notre calendrier de publication. Cependant nous emettrons toujours un rappel lors de la dernière version stable de chaque année civile.

On se revoit en 2024!

· 4 mins de lecture

Electron 27.0.0 est disponible ! Cette version inclut les mises à jour vers Chromium 118.0.5993.32, V8 11.8, et Node.js 18.17.1.


L’équipe Electron est heureuse d’annoncer la sortie d’Electron 27.0.0 ! Vous pouvez l'installer via npm install electron@latest ou la télécharger depuis notre site officiel. Vous obtiendrez plus de détails sur cette version en lisant ce qui suit.

Si vous avez des commentaires, veuillez nous les partager sur Twitter ou Mastodon, ou rejoignez notre communauté Discord! Les bogues et les demandes de fonctionnalités peuvent être signalés dans le traqueur de tickets d'Electron.

Changements notables

Changements de la Stack

Changements majeurs avec rupture de compatibilité

Supprimé: support de macOS 10.13 / 10.14

macOS 10.13 (High Sierra) et macOS 10.14 (Mojave) ne sont plus pris en charge par Chromium.

Les anciennes versions d'Electron continueront à fonctionner sur ces systèmes d'exploitation, mais macOS 10. 3 (High Sierra) ou plus récent sera nécessaire pour exécuter Electron v20.0.0 et supérieur.

Déprécié : ipcRenderer.sendTo()

La méthode ipcRenderer.sendTo() a été dépréciée. Elle devra être remplacée par la mise en place d'un MessageChannel entre les moteurs de rendu.

Les propriétés senderId et senderIsMainFrame de IpcRendererEvent ont également été dépréciées.

Supprimé: les événements du color scheme dans systemPreferences

Les événements suivants de systemPreferences ont été supprimés:

  • inverted-color-scheme-changed
  • high-contrast-color-scheme-changed

Utilisez à la place le nouvel événement updated du module nativeTheme.

// Supprimé
systemPreferences.on('inverted-color-scheme-changed', () => {
/* ... */
});
systemPreferences.on('high-contrast-color-scheme-changed', () => {
/* ... */
});

// A remplacer par
nativeTheme.on('updated', () => {
/* ... */
});

Supprimé : webContents.getPrinters

La méthode webContents.getPrinters a été supprimée. Utilisez webContents.getPrintersAsync à la place.

const w = new BrowserWindow({ show: false });

// A Supprimer
console.log(w.webContents.getPrinters());
//Et remplacer par
w.webContents.getPrintersAsync().then((printers) => {
console.log(printers);
});

Supprimé: systemPreferences.{get,set}AppLevelAppearance et systemPreferences.appLevelAppearance

Les méthodes systemPreferences.getAppLevelAppearance et systemPreferences.setAppLevelAppearance sont obsolètes et supprimées, ainsi que la propriété systemPreferences.appLevelAppearance. Utiliser l'Api nativeTheme à la place .

// A supprimer
systemPreferences.getAppLevelAppearance();
// Et remplacer par
nativeTheme.shouldUseDarkColors;

// A supprimer
systemPreferences.appLevelAppearance;
// Et remplacer par
nativeTheme.shouldUseDarkColors;

// A supprimer
systemPreferences.setAppLevelAppearance('dark');
// Et remplacer par
nativeTheme.themeSource = 'dark';

Supprimé: La valeur alternate-selected-control-text de systemPreferences.getColor

La valeur alternate-selected-control-text pour systemPreferences.getColor a été supprimée. Utilisez selected-content-background à la place.

// Supprimé
systemPreferences.getColor('alternate-selected-control-text');
// Remplacé par
systemPreferences.getColor('selected-content-background');

Nouvelles fonctionnalités

  • Ajout des paramètres de transparence d’accessibilité de l’application #39631
  • Ajout de la prise en charge des API d’extension chrome.scripting#39675
  • Activation de WaylandWindowDecorations par défaut #39644

Fin du support pour 24.x.y

Electron 24.x.y a atteint la limite pour le support conformément à la politique d'assistance 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.

E27 (Oct'23)E28 (Dec'23)E29 (Fev'24)
27.x.y28.x.y29.x.y
26.x.y27.x.y28.x.y
25.x.y26.x.y27.x.y

Fin du support pour 22.x.y

Un peu plus tôt cette année, l’équipe Electron a prolongé la date de fin de vie prévue de l’Electron 22 du 30 mai 2023 au 10 octobre 2023, afin de correspondre au support étendu de Chrome pour Windows 7/8/8.1 (voir Farewell, Windows 7/8/8.1 pour plus de détails).

Electron 22.x. y a atteint sa fin du support conformément à la politique de support du projet et à cette extension de support. Cela ramènera le support aux trois dernières versions majeures stables et mettra fin au support officiel de Windows 7/8/8.1.

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.

Vous pouvez trouver la chronologie publique d'Electron ici.

Vous trouverez plus d’informations sur les changements futurs sur la page changements de rupture prévus.

· 5 mins de lecture

Plus d’une semaine s’est écoulée depuis que CVE-2023-4863 : Heap buffer overflow in WebP a été rendu public, entraînant une vague de nouvelles versions des webp de rendu logiciel : macOS, iOS, Chrome, Firefox et diverses distributions Linux ont tous reçu des mises à jour. Cela fait suite aux enquêtes menées par Citizen Lab, qui a découvert qu’un iPhone utilisé par une « organisation de la société civile basée à Washington DC » était attaqué à l’aide d’un exploit sans clic dans iMessage.

Pour Electron, nous sommes également passé à l’action et a publié de nouvelles versions le jour même : Si votre application affiche du contenu fourni par l’utilisateur, vous devez mettre à jour votre version d’Electron - v27.0.0-beta.2, v26.2.1, v25.8.1, v24.8.3 et v22.3.24 contiennent toutes une version corrigée de libwebp, la bibliothèque responsable du rendu des images webp.

Maintenant que nous sommes tous nouvellement conscients qu’une interaction aussi innocente que « le rendu d'une image » soit une activité potentiellement dangereuse, nous voulons profiter de cette occasion pour rappeler à tous que Electron est livré avec un bac à sable des processus qui limitera le rayon d’action d'une éventuelle grosse attaque - quelle qu’elle soit.

Le bac à sable était disponible depuis Electron v1 et activé par défaut dans v20, mais nous savons que de nombreuses applications (en particulier celles qui existent depuis un certain temps) peuvent avoir un sandbox: false quelque part dans leur code – ou un nodeIntegration: true, qui désactive également la sandbox lorsqu’il n’y a pas de paramètre sandbox explicite. C’est compréhensible : Si vous êtes avec nous depuis longtemps, vous avez probablement apprécié le pouvoir de lancer un require("child_process") ou un require("fs") dans le même code qui exécute votre HTML/CSS.

Avant de parler de comment migrer vers le bac à sable, voyons d’abord pourquoi vous le souhaitez.

The sandbox puts a hard cage around all renderer processes, ensuring that no matter what happens inside, code is executed inside a restricted environment. As a concept, it's a lot older than Chromium, and provided as a feature by all major operating systems. Electron's and Chromium's sandbox build on top of these system features. Even if you never display user-generated content, you should consider the possibility that your renderer might get compromised: Scenarios as sophisticated as supply chain attacks and as simple as little bugs can lead to your renderer doing things you didn't fully intend for it to do.

The sandbox makes that scenario a lot less scary: A process inside gets to freely use CPU cycles and memory — that’s it. Processes cannot write to disk or display their own windows. In the case of our libwep bug, the sandbox makes sure that an attacker cannot install or run malware. In fact, in the case of the original Pegasus attack on the employee’s iPhone, the attack specifically targeted a non-sandboxed image process to gain access to the phone, first breaking out of the boundaries of the normally sandboxed iMessage. When a CVE like the one in this example is announced, you still have to upgrade your Electron apps to a secure version — but in the meantime, the amount of damage an attacker can do is limited dramatically.

Migrating a vanilla Electron application from sandbox: false to sandbox: true is an undertaking. I know, because even though I have personally written the first draft of the Electron Security Guidelines, I have not managed to migrate one of my own apps to use it. That changed this weekend, and I recommend that you change it, too.

Don’t be scared by the number of line changes, most of it is in &lt;code&gt;package-lock.json&lt;/code&gt;

There are two things you need to tackle:

  1. If you’re using Node.js code in either preload scripts or the actual WebContents, you need to move all that Node.js interaction to the main process (or, if you are fancy, a utility process). Given how powerful renderers have become, chances are high that the vast majority of your code doesn’t really need refactoring.

    Consult our documentation on Inter-Process Communication. In my case, I moved a lot of code and wrapped it in ipcRenderer.invoke() and ipcMain.handle(), but the process was straightforward and quickly done. Be a little mindful of your APIs here - if you build an API called executeCodeAsRoot(code), the sandbox won't protect your users much.

  2. Since enabling the sandbox disables Node.js integration in your preload scripts, you can no longer use require("../my-script"). In other words, your preload script needs to be a single file.

    There are multiple ways to do that: Webpack, esbuild, parcel, and rollup will all get the job done. I used Electron Forge’s excellent Webpack plugin, users of the equally popular electron-builder can use electron-webpack.

All in all, the entire process took me around four days — and that includes a lot of scratching my head at how to wrangle Webpack’s massive power, since I decided to use the opportunity to refactor my code in plenty of other ways, too.

· 3 mins de lecture

Electron 26.0.0 est disponible ! Cette version inclut les mises à jour vers Chromium 116.0.5845.62, V8 11.2, et Node.js 18.16.1. Lisez la suite ci-dessous pour plus de détails !


L’équipe Electron est heureuse d’annoncer la sortie d’Electron 26.0.0 ! Vous pouvez l'installer via npm install electron@latest ou la télécharger depuis notre site officiel. Vous obtiendrez plus de détails sur cette version en lisant ce qui suit.

Pour tout commentaire, veuillez partager avec nous sur Twitter, ou rejoindre notre communauté Discord! Les bogues et les demandes de fonctionnalités peuvent être signalés dans le traqueur de tickets d'Electron.

Changements notables

Changements de la Stack

Changements majeurs avec rupture de compatibilité

Déprécié : webContents.getPrinters

La méthode webContents.getPrinters a été dépréciée. Utilisez webContents.getPrintersAsync à la place.

const w = new BrowserWindow({ show: false });

// Déprécié
console.log(w.webContents.getPrinters());
// Remplacer par
w.webContents.getPrintersAsync().then((printers) => {
console.log(printers);
});

Déprécié: systemPreferences.{get,set}AppLevelAppearance and systemPreferences.appLevelAppearance

Les méthodes systemPreferences.getAppLevelAppearance et systemPreferences.setAppLevelAppearance sont obsolètes, ainsi que la propriété systemPreferences.appLevelAppearance. Utiliser l'Api nativeTheme à la place .

// Déprécié
systemPreferences.getAppLevelAppearance();
// Remplacer par
nativeTheme.shouldUseDarkColors;

// Déprécié
systemPreferences.appLevelAppearance;
// Remplacer par
nativeTheme.shouldUseDarkColors;

// Déprécié
systemPreferences.setAppLevelAppearance('dark');
// Remplacer par
nativeTheme.themeSource = 'dark';

Déprécié: valeur alternate-selected-control-text pour systemPreferences.getColor

Déprécié: la valeur alternate-selected-control-text pour systemPreferences.getColor. Utilisez selected-content-background à la place.

// Déprécié
systemPreferences.getColor('alternate-selected-control-text');
// A Remplacer par
systemPreferences.getColor('selected-content-background');

Nouvelles fonctionnalités

  • Added safeStorage.setUsePlainTextEncryption and safeStorage.getSelectedStorageBackend api. #39107
  • Added safeStorage.setUsePlainTextEncryption and safeStorage.getSelectedStorageBackend api. #39155
  • Added senderIsMainFrame to messages sent via ipcRenderer.sendTo(). #39206
  • Added support for flagging a Menu as being keyboard initiated. #38954

Fin du support pour 23.x.y

Electron 23.x.y a atteint la limite pour le support conformément à la politique d'assistance 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.

E26 (Aout'23)E27 (Oct'23)E28 (Jan'24)
26.x.y27.x.y28.x.y
25.x.y26.x.y27.x.y
24.x.y25.x.y26.x.y
22.x.y

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.

Vous pouvez trouver la chronologie publique d'Electron ici.

Vous trouverez plus d’informations sur les changements futurs sur la page changements de rupture prévus.