Questions tagged [electron]

Electron (formerly Atom Shell) is a framework created by GitHub that lets you write cross-platform desktop applications using HTML, CSS and JavaScript. Electron is based upon Node.js and Chromium.

Electron (formerly Atom Shell) project was originally started by Cheng Zhao, one of the authors of NW.js (formerly known as node-WebKit), another Node.js-based platform for building desktop applications using HTML, CSS, and JavaScript. Cheng Zhao was hired by GitHub and began work on the framework on or about April 11th, 2013. On the 17th of April, 2015, with the release of version 0.24 the framework was renamed from Atom Shell to Electron.

One of the differences between Electron and NW.js frameworks is that the entry point for the app is actual JavaScript instead of an HTML page. This makes Electron more suitable for testing with PhantomJS, for instance.

Another difference is that the build process is also simpler for Electron using electron-builder, electron-forge and electron-packager. Since Electron uses libchromiumcontent to access Chromium's Content API, it's no longer required to obtain a copy of the Chromium source code. On that same note, the integration with Chromium is much more loosely coupled than in case of NW.js (which requires Chromium to be patched and maintained separately by the NW.js developers).

Probably, the most popular application built on top of Electron is a hackable text editor called Atom (also from GitHub). But there are some other interesting projects like Vivaldi Web browser, Mapbox Studio, an email client from Nylas, Slack desktop application, Pixate, Fireball game editor, Visual Studio Code, an SQL editor called Wagon, Mac app that runs Docker containers called Kitematic.


Resources :

15116 questions
85
votes
13 answers

How to deploy an Electron app as an executable or installable in Windows?

I want to generate a unique .exe file to execute the app or a .msi to install the application. How to do that?
Amirado
  • 1,053
  • 1
  • 8
  • 12
83
votes
1 answer

Node-Webkit vs Electron

We are planning to built cross platform desktop application. We found that Node-Webkit is a perfect choice for us. But GitHub developed their own framework called Electron instead of using Node-Webkit. What is the difference between them?
Fizer Khan
  • 88,237
  • 28
  • 143
  • 153
82
votes
10 answers

electron 5.0.0 "Uncaught ReferenceError: require is not defined"

I had initially been using electron stable (4.x.x), and was able to use require in both my browser and renderer processes. I upgraded to electron beta (5.0.0) because I needed a newer version of node and encountered this error message in my renderer…
junvar
  • 11,151
  • 2
  • 30
  • 46
80
votes
22 answers

How do I reload a page with react-router?

I can see in this file (https://github.com/ReactTraining/react-router/blob/v0.13.3/modules/createRouter.js) that there is a refresh function but I have no idea how to call it. I'm fairly new to react-router, I've only used it to move between some…
Sheriff
  • 937
  • 1
  • 7
  • 10
79
votes
5 answers

Electron Take Up 100% Of Screen (Not Full Screen)

I've got an electron app, below is the main.js file: var app = require('electron').app; var BrowserWindow = require('electron').BrowserWindow; app.on('ready', function() { mainWindow = new BrowserWindow({ height: 715, width:…
user6806935
76
votes
2 answers

What is the Client/Server model when using Electron (Atom Shell)?

I'm trying to wrap my head around how Electron (formerly Atom Shell) works. I'm coming from a traditional, MVC-style web application where a Browser is calling a Controller Action through a Routing System, the Controller then fetches data from a…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
73
votes
8 answers

Electron.js How to minimize/close window to system tray and restore window back from tray?

I want my Electron.js application to live on system tray and whenever the user wants to do something they can restore from the system tray do something and minimize/close it back to system tray. How do i do that? I've seen the tray section from the…
miqe
  • 3,209
  • 2
  • 28
  • 36
72
votes
12 answers

Make a link from Electron open in browser

Is there any (simple/built-in way) to open a new browser (I mean default OS browser) window for a link from Electron instead of visiting that link inside your Electron app ?
saadel
  • 1,617
  • 1
  • 14
  • 19
71
votes
5 answers

Electron.remote is undefined

I have trouble with using Electron. As you can see the title, when i load remote module, it saids it is undefined. This is the code of entry js: const electron = require('electron'); const { app, BrowserWindow, Tray, remote, ipcMain } =…
modernator
  • 4,341
  • 12
  • 47
  • 76
71
votes
12 answers

How can I force external links from browser-window to open in a default browser from Electron?

I'm using the BrowserWindow to display an app and I would like to force the external links to be opened in the default browser. Is that even possible or I have to approach this differently?
Lipis
  • 21,388
  • 20
  • 94
  • 121
70
votes
1 answer

How To Compile An Electron Application To A .exe

I've been learning how to create applications in Electron and I need help compiling a simple project to a Windows executable. The program is a clone from this Github repo: https://github.com/electron/electron-quick-start. On the repo readme it shows…
69
votes
1 answer

How to read audio data from a 'MediaStream' object in a C++ addon

After sweating blood and tears I've finally managed to set up a Node C++ addon and shove a web-platform standard MediaStream object into one of its C++ methods for good. For compatibility across different V8 and Node.js versions, I'm using Native…
John Weisz
  • 30,137
  • 13
  • 89
  • 132
69
votes
9 answers

How to use React Router with Electron?

Using this boilerplate as reference I created an Electron app. It uses webpack to bundle the scripts and express server to host it. Webpack config is practically same as this and server this. Electron's script loads: mainWindow.loadURL('file://' +…
Frozen Crayon
  • 5,172
  • 8
  • 36
  • 71
68
votes
3 answers

rename process using pm2 programmatic api

I have an electron app which uses pm2 to start some apps using the pm2 module.Everything is fine.However I am trying to implement the following feature:Renaming an app you have started.I know that using the cli I can do the following: pm2 restart…
Manos Kounelakis
  • 2,848
  • 5
  • 31
  • 55
68
votes
8 answers

How to persist data in an Electron app?

I've been scouring the Electron documentation to try and figure out how to persist data in an Electron app. For example, in iOS or OS X, you could use NSUserDefaults to store user settings and preferences. I would like to do something similar. How…
Andrew
  • 227,796
  • 193
  • 515
  • 708