Get your Bluetooth headsets ready: Electron 16 learns to talk with human interface devices

Electron 16

Electron — a central building block of Visual Studio Code, WhatsApp, and Twitch — has made a version jump and is available in v16. 

Amongst other things, the team behind cross-platform app development framework was able to finish its work on support for WebHID in time for the release. The experimental API allows the utilisation of Human Interface Devices via USB, or a couple of other protocols like Bluetooth. It provides developers with new events to programmatically select HIDs and query availability, as well as a handler to supply devices with default permissions without the need to call other functions first.

To extend the array of security features users can integrate into their applications, Electron has learned to work with the Universal 2nd Factor Web API, and now passes a securityOrigin field to media permissions request handlers. It also comes with a cookie encryption API called safeStorage and functionality for enforcing code signatures on the app.asar file applications load.

Other highlighted enhancements include a way of letting apps remove command line switches from Chromium’s internal command line representation so that certain features can’t be used, and a parameter to help share data between instances.

Since Electron is based on Node.js, Chromium, and V8, version 16 updates these dependencies which therefore stand at 16.9.1, 96, and 9.6 respectively. Details on changes and fixes can be found in the release notes

Version 16 is the second release that follows the eight-week release cycle announced in July. Back then the Electron team decided to up its pace to make sure it matches Chromium’s shortened release cadence and a change in the rules of the Microsoft Store, which meant Chromium-based apps have to be within the last two major versions. 

The next release however could potentially take a little while longer, since the Electron project decided to pause activities in December to give maintainers a chance to recharge. Major security-related issues will still be tackled as they arise and moderation will continue, though no betas or stable versions are planned to drop and PR reviews, issue tracker updates, debugging help and content creation will be put on hold for the month. Users shouldn’t worry about the project though, as the team plans to “return to full speed in January 2022”.

The availability of Electron 16 marks the end of support for the project’s 12.x.y series, so developers maintaining apps still using a corresponding release are encouraged to upgrade. Before doing so, users should be aware that the desktopCapturer.getSources API from the renderer process has been deprecated with the release, which could lead to issues with existing code. 

Another breaking change was introduced to match Chrome’s behaviour on Linux, making sure the crashReporter API uses Crashpad instead of Breakpad on the open source operating system. This step not only unifies performance, but also adds automatic monitoring of child processes. It means though, that calls to process.crashReporter.start in Node child processes should be deleted, as they will start a second instance of the Crashpad reporter.