Electron 23.0.0 has been released! It includes upgrades to Chromium 110, V8 11.0, and Node.js 18.12.1. Additionally, support for Windows 7/8/8.1 has been dropped. Read below for more details!
The Electron team is excited to announce the release of Electron 23.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.
If you have any feedback, please share it with us on Twitter, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.
Electron 22.0.0 has been released! It includes a new utility process API, updates for Windows 7/8/8.1 support, and upgrades to Chromium 108, V8 10.8, and Node.js 16.17.1. Read below for more details!
The Electron team is excited to announce the release of Electron 22.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.
If you have any feedback, please share it with us on Twitter, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.
2023/02/16: An update on Windows Server 2012 support
Last month, Google announced that
Chrome 109 would continue to receive critical security fixes for
Windows Server 2012 and Windows Server 2012 R2 until October 10, 2023.
In accordance, Electron 22's (Chromium 108) planned end of life date will be extended from May 30, 2023 to October 10, 2023. The Electron team will continue to backport any security fixes that are part of this program to Electron 22 until October 10, 2023.
Note that we will not make additional security fixes for Windows 7/8/8.1.
Also, Electron 23 (Chromium 110) will only function on Windows 10 and above as
previously announced.
The new UtilityProcess main process module allows the creation of a lightweight Chromium child process with only Node.js integration while also allowing communication with a sandboxed renderer using MessageChannel. The API was designed based on Node.js child_process.fork to allow for easier transition, with one primary difference being that the entry point modulePath must be from within the packaged application to allow only for trusted scripts to be loaded. Additionally the module prevents establishing communication channels with renderers by default, upholding the contract in which the main process is the only trusted process in the application.
Added support for Web Bluetooth pin pairing on Linux and Windows. #35416
Added LoadBrowserProcessSpecificV8Snapshot as a new fuse that will let the main/browser process load its v8 snapshot from a file at browser_v8_context_snapshot.bin. Any other process will use the same path as is used today. #35266
Added WebContents.opener to access window opener and webContents.fromFrame(frame) to get the WebContents corresponding to a WebFrameMain instance. #35140
Added support for navigator.mediaDevices.getDisplayMedia via a new session handler, ses.setDisplayMediaRequestHandler. #30702
Electron 22 will be the last Electron major version to support Windows versions older than 10. Windows 7/8/8.1 will not be supported in Electron 23 and later major releases. Older versions of Electron will continue to function on Windows 7, and we will continue to release patches for Electron the 22.x series until May 30 2023, when Electron will end support for 22.x (according to our support timeline).
Electron follows the planned Chromium deprecation policy, which will deprecate support in Chromium 109 (read more about Chromium's timeline here). Electron 23 will contain Chromium 110, which won’t support older versions of Windows.
Electron 22, which contains Chromium 108, will thus be the last supported version.
The following is our planned deprecation timeline:
December 2022: The Electron team is entering a quiet period for the holidays
January 2023: Windows 7 & 8 related issues are accepted for all supported release branches.
February 7 2023: Electron 23 is released.
February 8 2023 - May 29 2023: Electron will continue to accept fixes for supported lines older than Electron 23.
May 30 2023: Electron 22 reaches the end of its support cycle.
What this means for developers:
The Electron team will accept issues and fixes related to Windows 7/8/8.1 for stable supported lines, until each line reaches the end of its support cycle.
This specifically applies to Electron 22, Electron 21 and Electron 20.
New issues related to Windows 7/8/8.1 will be accepted for Electron versions older than Electron 23.
New issues will not be accepted for any newer release lines.
Once Electron 22 has reached the end of its support cycle, all existing issues related to Windows 7/8/8.1 will be closed.
info
2023/02/16: An update on Windows Server 2012 support
Last month, Google announced that
Chrome 109 would continue to receive critical security fixes for
Windows Server 2012 and Windows Server 2012 R2 until October 10, 2023.
In accordance, Electron 22's (Chromium 108) planned end of life date will be extended from May 30, 2023 to October 10, 2023. The Electron team will continue to backport any security fixes that are part of this program to Electron 22 until October 10, 2023.
Note that we will not make additional security fixes for Windows 7/8/8.1.
Also, Electron 23 (Chromium 110) will only function on Windows 10 and above as
previously announced.
Please feel free to write to us at info@electronjs.org if you have any questions or concerns. You can also find community support in our official Electron Discord.
With the success of December Quiet Month 2021, we wanted to bring it back for 2022. December continues to be a quiet month for most companies, so we want to give our maintainers a chance to recharge. Everyone is looking forward to 2023, and we expect good things to come! We encourage other projects to consider similar measures.
We are excited to announce that Electron Forge v6.0.0 is now available! This release marks the first major release of Forge since 2018 and moves the project from electron-userland into the main electron organization on Github.
Keep on reading to see what's new and how your app can adopt Electron Forge!
Electron Forge is a tool for packaging and distributing Electron applications. It unifies Electron's build tooling ecosystem into a single extensible interface so that anyone can jump right into making Electron apps.
Highlight features include:
📦 Application packaging and code signing
🚚 Customizable installers on Windows, macOS, and Linux (DMG, deb, MSI, PKG, AppX, etc.)
From v1 to v5, Electron Forge was based on the now-discontinued electron-compile project. Forge 6 is a complete rewrite of the project with a new modular architecture that can be extended to meet any Electron application's needs.
In the past few years, Forge v6.0.0-beta has achieved feature parity with v5 and code churn has slowed down dramatically, making the tool ready for general adoption.
Don't install the wrong package
For versions 5 and below, Electron Forge was published to the electron-forge package on npm.
Starting with the v6 rewrite, Forge is instead structured as a monorepo project with many smaller
projects.
Historically, Electron maintainers have been unopinionated about build tooling, leaving the task to various community packages. However, with Electron maturing as a project, it has become harder for new Electron developers to understand which tools they need to build and distribute their apps.
To help guide Electron developers in the distribution process, we have have decided to make Forge the official batteries-included build pipeline for Electron.
Over the past year, we have been slowly integrating Forge into the official Electron documentation, and we have recently moved Forge over from its old home in electron-userland/electron-forge to the electron/forge repo. Now, we are finally ready to release Electron Forge to a general audience!
Scaffolding a new Electron Forge project can be done using the create-electron-app CLI script.
Yarn
npm
yarn create electron-app my-app --template=webpack cd my-app yarn start
npm init electron-app@latest my-app -- --template=webpack cd my-app npm start
The script will create an Electron project in the my-app folder with completely JavaScript bundling and a preconfigured build pipeline.
For more info, see the Getting Started guide in the Forge docs.
First-class webpack support
The above snippet uses Forge's Webpack Template, which we recommend as a starting point for new Electron projects. This template is built around the @electron-forge/plugin-webpack plugin, which integrates webpack with Electron Forge in a few ways, including:
enhancing local dev flow with webpack-dev-server, including support for HMR in the renderer;
handling build logic for webpack bundles before application packaging; and
adding support for Native Node modules in the webpack bundling process.
When you use the import command, Electron Forge will add a few core dependencies and create a new forge.config.js configuration. If you have any existing build tooling (e.g. Electron Packager, Electron Builder, or Forge 5), it will try to migrate as many settings as possible. Some of your existing configuration may need to be migrated manually.
If you already have tooling for packaging and publishing your Electron app, the benefits associated with adopting Electron Forge can still outweigh the initial switching cost.
We believe there are two main benefits to using Forge:
Forge receives new features for application building as soon as they are supported in Electron. In this case, you won't need to wire in new tooling support yourself, or wait for that support to be eventually implemented by other packages before upgrading. For recent examples, see macOS universal binaries and ASAR integrity checking.
Forge's multi-package architecture makes it easy to understand and extend. Since Forge is made up of many smaller packages with clear responsibilities, it is easier to follow code flow. In addition, Forge's extensible API design means that you can write your own additional build logic separate from the provided configuration options for advanced use cases. For more details on writing custom Forge plugins, makers, and publishers, see the Extending Electron Forge section of the docs.
Forge 6 has spent a long time in the beta phase, and its release cadence has gradually slowed down. However, we have accelerated development in the second half of 2022 and used the last few releases to push some final breaking changes before the v6.0.0 stable release.
If you are an Electron Forge 6 beta user, see the v6.0.0 GitHub release notes for a list of breaking changes made in recent betas (>=6.0.0-beta.65).
A complete list of changes and commits can be found in the repo's CHANGELOG.md.
Tell us what you need! The Electron Forge team is always looking to build the project to better suit its users.
You can help us improve Electron Forge by submitting feature requests, posting issues, or just letting us know your feedback! You can also join us in the official Electron Discord server, where there is a dedicated channel for Electron Forge discussion.
Last month, Electron’s maintainer group met up in Vancouver, Canada to discuss the direction of the
project for 2023 and beyond. Over four days in a conference room, core maintainers and invited
collaborators discussed new initiatives, maintenance pain points, and general project health.
Going forward, the team will still be fully dedicated to releasing regular and rapid
Chromium upgrades, fixing bugs, and making Electron more secure and performant for everyone.
We also have a few exciting projects in the works we would love to share with
the community!
Major API proposals in the Electron project that require consensus go through a Request for Comments
(RFC) process, which gets reviewed by members of our API Working Group.
This year, we have driven forward two major proposals that have the potential to unlock a new
dimension of capabilities for Electron apps. These proposals are highly experimental, but here’s a
sneak peek of what to expect!
This proposal outlines a new layer of Electron C APIs that will allow app developers to write their
own Native Node Addons that interface with Electron’s internal resources, similar to Node’s
own Node-API. More information about the proposed new API can be found here.
Example: Supercharging apps with Chromium resources
Many Electron apps maintain their own forks to interact directly with Chromium internals that would
otherwise be inaccessible with vanilla (unmodified) Electron. By exposing these resources in the C
API layer, this code can instead live as a native module alongside Electron, potentially reducing
app developer maintenance burden.
Under the hood, the non-website parts of Chrome’s user interface (UI), such as toolbars, tabs, or
buttons, are built with a framework called Views. The Views API proposal introduces parts of this
framework as JavaScript classes in Electron, with the eventual goal of allowing developers to create
non-web UI elements to their Electron applications. This will prevent apps from having to hack
together web contents.
The groundwork to make this new set of APIs possible is currently in progress. Here are a few of the
first things you can expect in the near future.
Example: Refactoring the window model with WebContentsView
Our first planned change is to expose Chrome’s WebContentsView to Electron’s API surface, which will
be the successor to our existing BrowserView API (which, despite the name, is Electron-specific code
unrelated to Chromium Views). With WebContentsView exposed, we will have a reusable View object that
can display web contents, opening the door to making the BrowserWindow class pure JavaScript and
eliminating even more code complexity.
Although this change doesn’t provide a lot of new functionality to app developers, it is a large
refactor that eliminates a lot of code under the hood, simplifying Chromium upgrades and reducing
the risk of new bugs appearing between major versions.
If you’re an Electron developer using BrowserViews in your app: don’t worry, we haven’t forgotten
about you! We plan on making the existing BrowserView class a shim for WebContentsView to provide a
buffer as you transition to the newer APIs.
Our friends at Stack have been driving an initiative to expose the Chromium ScrollView component to
Electron’s API. With this new API, any child View component can be made scrollable horizontally or
vertically.
Although this new API fulfills a single smaller functionality, the team’s eventual goal is to build
a set of utility View components that can be used as a toolkit to build more complex non-HTML
interfaces.
Are you an Electron app developer interested in either of these API proposals? Although we’re not
quite ready to receive additional RFCs, please stay tuned for more details in the future!
Since the framework’s inception, Electron’s build tooling ecosystem has been largely
community-driven and has consisted of many small single-purpose packages (e.g. electron-winstaller,
electron-packager, electron-notarize, electron-osx-sign). Although these tools work well, it’s
intimidating for users to piece together a working build pipeline.
To help build a friendlier experience for Electron developers, we built Electron Forge, an
all-in-one solution that combines all this existing tooling into a single interface. Although Forge
has been in development since 2017, the project has lain dormant for the last few years. However,
given community feedback on the state of build tooling in Electron, we have been hard at work on
releasing the next-gen stable major version of Forge.
Electron Forge 6 comes with first-class TypeScript and Webpack support, as well as an extensible
API that allows developers to create their own plugins and installers.
If you’re interested in building a project with Forge or building templates or plugins with Forge’s
extensible third-party APIs, stay tuned for our official announcement on the Forge v6 stable
release sometime this month!
Aside from the above, the team is always thinking of a bunch of exploratory projects to make the
Electron experience better for app developers and end users. Updater tooling, API review processes,
and enhanced documentation are other things we are experimenting with. We hope to have more news to
share in the near future!
Electron 21.0.0 has been released! It includes upgrades to Chromium 106, V8 10.6, and Node.js 16.16.0. Read below for more details!
The Electron team is excited to announce the release of Electron 21.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release.
If you have any feedback, please share it with us on Twitter, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.
Electron 20.0.0 has been released! It includes upgrades to Chromium 104, V8 10.4, and Node.js 16.15.0. Read below for more details!
The Electron team is excited to announce the release of Electron 20.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release and please share any feedback you have!
Electron 21 and later will have the V8 Memory Cage enabled, with implications for some native modules.
Update (2022/11/01)
To track ongoing discussion about native module usage in Electron 21+, see electron/electron#35801.
In Electron 21, we will be enabling V8 sandboxed pointers in Electron, following Chrome's decision to do the same in Chrome 103. This has some implications for native modules. Also, we previously enabled a related technology, pointer compression, in Electron 14. We didn't talk about it much then, but pointer compression has implications for the maximum V8 heap size.
These two technologies, when enabled, are significantly beneficial for security, performance and memory usage. However, there are some downsides to enabling them, too.
The main downside of enabling sandboxed pointers is that ArrayBuffers which point to external ("off-heap") memory are no longer allowed. This means that native modules which rely on this functionality in V8 will need to be refactored to continue working in Electron 20 and later.
The main downside of enabling pointer compression is that the V8 heap is limited to a maximum size of 4GB. The exact details of this are a little complicated—for example, ArrayBuffers are counted separately from the rest of the V8 heap, but have their own limits.
The Electron Upgrades Working Group believes that the benefits of pointer compression and the V8 memory cage outweigh the downsides. There are three main reasons for doing so:
It keeps Electron closer to Chromium. The less Electron diverges from Chromium in complex internal details such as V8 configuration, the less likely we are to accidentally introduce bugs or security vulnerabilities. Chromium's security team is formidable, and we want to make sure we are taking advantage of their work. Further, if a bug only affects configurations that aren't used in Chromium, fixing it is not likely to be a priority for the Chromium team.
It's more secure. Some Electron apps run untrusted JavaScript (hopefully following our security recommendations!), and for those apps, having the V8 memory cage enabled protects them from a large class of nasty V8 vulnerabilities.
Lastly, there are workarounds for apps that really need a larger heap size. For example, it is possible to include a copy of Node.js with your app, which is built with pointer compression disabled, and move the memory-intensive work to a child process. Though somewhat complicated, it is also possible to build a custom version of Electron with pointer compression disabled, if you decide you want a different trade-off for your particular use case. And lastly, in the not-too-distant future, wasm64 will allow apps built with WebAssembly both on the Web and in Electron to use significantly more than 4GB of memory.
How will I know if my app is impacted by this change?
Attempting to wrap external memory with an ArrayBuffer will crash at runtime in Electron 20+.
If you don't use any native Node modules in your app, you're safe—there's no way to trigger this crash from pure JS. This change only affects native Node modules which allocate memory outside of the V8 heap (e.g. using malloc or new) and then wrap the external memory with an ArrayBuffer. This is a fairly rare use case, but some modules do use this technique, and such modules will need to be refactored in order to be compatible with Electron 20+.
How can I measure how much V8 heap memory my app is using to know if I'm close to the 4GB limit?
Some documents refer to it as the "V8 sandbox", but that term is easily confusable with other kinds of sandboxing that happen in Chromium, so I'll stick to the term "memory cage".
There's a fairly common kind of V8 exploit that goes something like this:
Find a bug in V8's JIT engine. JIT engines analyze code in order to be able to omit slow runtime type checks and produce fast machine code. Sometimes logic errors mean it gets this analysis wrong, and omits a type check that it actually needed—say, it thinks x is a string, but in fact it's an object.
Abuse this confusion to overwrite some bit of memory inside the V8 heap, for instance, the pointer to the beginning of an ArrayBuffer.
Now you have an ArrayBuffer that points wherever you like, so you can read and write any memory in the process, even memory that V8 normally doesn't have access to.
The V8 memory cage is a technique designed to categorically prevent this kind of attack. The way this is accomplished is by not storing any pointers in the V8 heap. Instead, all references to other memory inside the V8 heap are stored as offsets from the beginning of some reserved region. Then, even if an attacker manages to corrupt the base address of an ArrayBuffer, for instance by exploiting a type confusion error in V8, the worst they can do is read and write memory inside the cage, which they could likely already do anyway.
There's a lot more available to read on how the V8 memory cage works, so I won't go into further detail here—the best place to start reading is probably the high-level design doc from the Chromium team.
I want to refactor a Node native module to support Electron 21+. How do I do that?
There are two ways to go about refactoring a native module to be compatible with the V8 memory cage. The first is to copy externally-created buffers into the V8 memory cage before passing them to JavaScript. This is generally a simple refactor, but it can be slow when the buffers are large. The other approach is to use V8's memory allocator to allocate memory which you intend to eventually pass to JavaScript. This is a bit more involved, but will allow you to avoid the copy, meaning better performance for large buffers.
To make this more concrete, here's an example N-API module that uses external array buffers:
// Create some externally-allocated buffer. // |create_external_resource| allocates memory via malloc(). size_t length =0; void* data =create_external_resource(&length); // Wrap it in a Buffer--will fail if the memory cage is enabled! napi_value result; napi_create_external_buffer( env, length, data, finalize_external_resource,NULL,&result);
This will crash when the memory cage is enabled, because data is allocated outside the cage. Refactoring to instead copy the data into the cage, we get:
size_t length =0; void* data =create_external_resource(&length); // Create a new Buffer by copying the data into V8-allocated memory napi_value result; void* copied_data =NULL; napi_create_buffer_copy(env, length, data,&copied_data,&result); // If you need to access the new copy, |copied_data| is a pointer // to it!
This will copy the data into a newly-allocated memory region that is inside the V8 memory cage. Optionally, N-API can also provide a pointer to the newly-copied data, in case you need to modify or reference it after the fact.
Refactoring to use V8's memory allocator is a little more complicated, because it requires modifying the create_external_resource function to use memory allocated by V8, instead of using malloc. This may be more or less feasible, depending on whether or not you control the definition of create_external_resource. The idea is to first create the buffer using V8, e.g. with napi_create_buffer, and then initialize the resource into the memory that has been allocated by V8. It is important to retain a napi_ref to the Buffer object for the lifetime of the resource, otherwise V8 may garbage-collect the Buffer and potentially result in use-after-free errors.
Electron 19.0.0 has been released! It includes upgrades to Chromium 102, V8 10.2, and Node.js 16.14.2. Read below for more details!
The Electron team is excited to announce the release of Electron 19.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release and please share any feedback you have!
The project is returning to its earlier policy of supporting the latest three major versions. See our versioning document for more detailed information about Electron versioning and support. This had temporarily been four major versions to help users adjust to the new release cadence that began in Electron 15. You can read the full details here.