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
67
votes
8 answers

Can you use React Native to create a desktop application?

I'm making a desktop application with create-react-app and Electron. It needs to run on Mac, Windows and Linux. I also want to make a native version afterwards for Android and iOS. Can I just make an application in React Native that works on mobile…
riscos3
  • 1,617
  • 2
  • 11
  • 16
66
votes
3 answers

Saving files locally with electron

I have some template files that contain a few variable strings each, I'd like to build a very simple input form with Electron (https://www.electronjs.org/) and I want to save the composed output file on the user's computer. Is there any module I can…
Adriano
  • 3,788
  • 5
  • 32
  • 53
62
votes
6 answers

Uncaught Error: Cannot find module 'jquery'

I am using Electron to make a desktop app. In my app I am loading a an external site (outside Atom app) lets say http://mydummysite/index.html page. Here is the structure of my app in Atom Editor: i.e it is having following parts: main.js…
Raghav
  • 8,772
  • 6
  • 82
  • 106
61
votes
4 answers

How to prevent multiple instances in Electron

I do not know if this is possible but I might as well give it a chance and ask. I'm doing an Electron app and I'd like to know if it is possible to have no more than a single instance at a time. I have found this gist but I'm not sure hot to use it.…
Eduard
  • 3,395
  • 8
  • 37
  • 62
61
votes
6 answers

Python on Electron framework

I am trying to write a cross-platform desktop app using web technologies (HTML5, CSS, and JS). I took a look at some frameworks and decided to use the Electron framework. I've already done the app in Python, so I want to know if is possible to…
60
votes
8 answers

Play sound in Angular 4

I'm working on an Electron app with Angular 4. I want to play sound on some specific action. Is there any module or code for that? It can be in the angular 4 or if electron is providing some service for that it should also work As I want to play it…
hardiksa
  • 1,477
  • 1
  • 14
  • 19
59
votes
10 answers

Why do Node modules go into .staging folder?

I have an Electron app that I'm trying to install node modules for. When I run npm install, it creates the node_modules folder but all the modules go into a subfolder called .staging. Each module also has -xxxxx appended to it, where the x's are…
4thSpace
  • 43,672
  • 97
  • 296
  • 475
58
votes
16 answers

Electron - Not allowed to load local resource

Evening, I'm looking into using electron to package an existing angular2 build. I thought I had a dry run working but the actual packaging seems to be failing (see final step below) and I want to understand why. Here's what I'm doing... Create…
popClingwrap
  • 3,919
  • 5
  • 26
  • 44
58
votes
2 answers

Passing Data to Windows in Electron

I'm learning Electron and working with multiple windows and IPC. In my main script I have the following: var storeWindow = new BrowserWindow({ width: 400, height: 400, show: false }); ipc.on('show-store-edit', function(event, store) { …
Gregg
  • 34,973
  • 19
  • 109
  • 214
57
votes
8 answers

How to get OS username in NodeJS?

How would I get/find the username that the computer owner is using currently (while logged in), using NodeJS? I have searched around a bit, but haven't found anything.
drowZ
  • 1,783
  • 2
  • 12
  • 17
56
votes
1 answer

When to use remote vs ipcRenderer, ipcMain

I'm trying to understand the communications between electrons main and renderer processes. The documentation https://github.com/electron/electron/blob/master/docs/api/remote.md states that the "remote module provides a simple way to do inter-process…
user1513388
  • 7,165
  • 14
  • 69
  • 111
54
votes
4 answers

Frameless window with controls in electron (Windows)

I want my app to have no title bar but still be closeable, draggable, minimizable, maximizable, and resizable like a regular window. I can do this in OS X since there is a [titleBarStyle] 1 option called hidden-inset that I can use but…
antonky
  • 768
  • 1
  • 8
  • 14
54
votes
8 answers

How to clear the cache data in Electron(atom shell)?

I want to clear cache data in Electron(atom-shell). I don't find any api like gui.App.clearCache()(node-webkit api to clear cache data) in Electron. If you find any api or any other way please let me know. comments are appreciated .
neel
  • 779
  • 1
  • 6
  • 11
51
votes
3 answers

Atom Electron - Close the window with javascript

I'm using Electron (formerly atom-shell) and would like to have a minimalist frame window so that the three OSX window buttons (close, maximize, minimize) are visible from within the HTML page. I set the Electron option frame to false when defining…
Arnaud Leymet
  • 5,995
  • 4
  • 35
  • 51
49
votes
6 answers

bundling precompiled binary into electron app

Is there a good solution on how to include third party pre compiled binaries like imagemagick into an electron app? there are node.js modules but they are all wrappers or native binding to the system wide installed libraries. I wonder if it's…
Toby
  • 2,720
  • 5
  • 29
  • 46