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.

Filter by
Sorted by
Tagged with
344
votes
19answers
158k views

Electron: jQuery is not defined

Problem: while developing using Electron, when you try to use any JS plugin that requires jQuery, the plugin doesn't find jQuery, even if you load in the correct path using script tags. For example, ...
206
votes
10answers
159k views

Electron require() is not defined

I'm creating an Electron app for my own purpose. My problem is when I'm using node functions inside my HTML page it throws an error of: 'require()' is not defined. Is there any way to use Node ...
187
votes
16answers
160k views

Remove menubar from Electron app

How do I remove this menu-bar from my electron apps: Also it says "Hello World"(is this because I downloaded electron pre-built, and will go away once I package the application?). I didn't code these ...
185
votes
11answers
151k views

How to set app icon for Electron / Atom Shell App

How do you set the app icon for your Electron app? I am trying BrowserWindow({icon:'path/to/image.png'}); but it does not work. Do I need to pack the app to see the effect?
182
votes
1answer
60k views

What is the Visual Studio Code editor built on

What underlying technologies/libraries is Microsoft's new (free) cross platform editor Visual Studio Code (Launched 5/29/2015) built on? There are rumors that it's just Github's Atom Editor rebranded....
177
votes
2answers
183k views

How to unpack an .asar file?

I have packed my Electron application using the following command: asar pack app app.asar Now, I need to unpack it and get the whole code back. Is there any way to do so?
153
votes
5answers
29k views

What are the functional differences between NW.js, Brackets-Shell and Electron?

Now that TideSDK is effectively dead, I've been looking into alternative 'wrappers' to run HTML/CSS/JS applications as stand-alone desktop applications. The three viable options I have run across so ...
141
votes
16answers
121k views

Using console.log() in Electron app

How can I log data or messages to the console in my Electron app? This really basic hello world opens the dev tools by default, by I am unable to use console.log('hi'). Is there an alternative for ...
137
votes
5answers
56k views

electron-builder vs electron-packager [closed]

What is main difference between electron-builder and electron-packager. Is there some example projects for both? Which is better for standalone .exe application build?
126
votes
4answers
66k views

What is the difference between const and const {} in JavaScript

When I study electron, I found 2 ways of getting BrowserWindow object. const {BrowserWindow} = require('electron') and const electron = require('electron') const BrowserWindow = electron....
112
votes
4answers
106k views

Typescript + React/Redux: Property "XXX" does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes

I'm working on a project with Typescript, React and Redux (all running in Electron), and I've run into a problem when I'm including one class based component in another and trying to pass parameters ...
111
votes
11answers
193k views

How to enable file upload on React's Material UI simple input?

I am creating a simple form to upload file using electron-react-boilerplate with redux form & material ui. The problem is that I do not know how to create input file field because material ui ...
99
votes
10answers
105k views

How to use sqlite3 module with electron?

I want to develop desktop app using electron that uses sqlite3 package installed via npm with the command npm install --save sqlite3 but it gives the following error in electron browser console ...
86
votes
6answers
60k views

Where to store user settings in Electron (Atom Shell) Application?

I can't seem to locate a built in mechanism to store user settings. I was hoping that electron provided a standard method for storing user settings across all desktop platforms. If there isn't a ...
85
votes
4answers
83k views

How to access DOM elements in electron?

I am trying to add functionality to a button in index.html file is as follows: I have a button element in index.html <button id="auth-button">Authorize</button> In main.js of the app, I ...
81
votes
1answer
40k views

Node-Webkit vs Electron [closed]

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....
75
votes
5answers
58k views

How to use preload.js properly in Electron

I'm trying to use Node modules (in this example, fs) in my renderer processes, like this: // main_window.js const fs = require('fs') function action() { console.log(fs) } Note: The action ...
74
votes
10answers
50k views

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 ...
74
votes
2answers
23k views

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 ...
71
votes
12answers
71k views

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?
70
votes
1answer
3k views

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 ...
65
votes
6answers
39k views

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, ...
63
votes
7answers
52k views

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 ...
63
votes
1answer
119k views

How To Compile An Electron Application To A .exe [duplicate]

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/...
60
votes
6answers
77k views

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....
58
votes
3answers
99k views

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 ...
57
votes
11answers
25k views

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?
56
votes
9answers
52k views

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 ?
56
votes
9answers
74k views

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 ...
56
votes
7answers
71k views

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 ...
56
votes
1answer
39k views

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 ...
55
votes
2answers
71k views

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('...
53
votes
8answers
83k views

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 ...
52
votes
5answers
56k views

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 ...
51
votes
7answers
49k views

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. ...
51
votes
3answers
39k views

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 ...
51
votes
4answers
70k views

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 ...
50
votes
12answers
68k views

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 ...
49
votes
3answers
90k views

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 ...
49
votes
4answers
56k views

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 ...
49
votes
9answers
67k views

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 ...
48
votes
2answers
31k views

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 ...
47
votes
8answers
38k views

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.
46
votes
17answers
180k views

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-...
45
votes
6answers
19k views

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 ...
45
votes
1answer
7k views

Warning: 'sandbox' is not in the list of known options, but still passed to Electron/Chromium

I am using Linux Mint 20 and vscode 1.52.1. My ~/.xsession-errors file shows Warning: 'sandbox' is not in the list of known options, but still passed to Electron/Chromium. What is causing this error ...
44
votes
8answers
74k views

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 ...
43
votes
12answers
41k views

dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib

Using electron-builder to build Windows app, When signing up, I got this error : dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib Referenced from: /Users/puss/Library/...
42
votes
7answers
37k views

Why do I see an "Electron Security Warning" after updating my Electron project to the latest version?

I've created Electron-Vuejs-Vuetify project from this Vuetify's boilerplate I'm seeing this warning in the console: Electron Security Warning This renderer process has Node.js integration enabled ...
41
votes
2answers
40k views

How to add a right-click menu in Electron that has "Inspect Element" option like Chrome?

I'm building an Electron application and I would like to inspect specific UI elements. I have the Chrome dev tools open for development, but what I want is to be able to right-click a UI element and ...

1
2 3 4 5
267