Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to strip unused features from electron.js binary

By design, electron.js contains all the features of a modern web browser: rendering engine, video / audio support, Web RTC, etc.

In result, electron.js applications are huge, have big memory footprints and relatively slow startup.

Do you know, is it possible to build electron.js from sources and strip unused / unneeded features of Chromium?

I want to have smaller binaries and faster startup time.

like image 955
jreznot Avatar asked Nov 08 '22 02:11

jreznot


1 Answers

Sadly, this is not possible. Electron bundles Node.js and Chromium in their full form, and there is no way to keep only part of them.

Some projects like Electrino have tried to get rid of this limitation, but it's still in early stage and hasn't been improved a lot this last year.

For Windows-only applications, you can still make a Universal Windows Platform application in HTML / CSS / JavaScript that will be a lot lighter.

Still, the only easy way to get rid of the big size of Electron is to use the operating system's internal browser coupled with, let's say, a Qt application. This would result in a program that is both light and powerful, with the ability to fully customize the application's behavior thanks to Qt. Still, this is a lot more difficult than making a simple Electron application.

like image 110
ClementNerma Avatar answered Jun 09 '23 16:06

ClementNerma