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.
13,175
questions
0
votes
0answers
5 views
Login authentication alternatives for MongoDB, shared across web app with persistent DB
I'm currently working on a desktop application with the use of electron. I've been working off MongoDB but after some research, I see that it requires the user to apply the installation of MongoDB, so ...
71
votes
5answers
53k 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 ...
0
votes
0answers
4 views
Is there any difference in the LRU policy using an electron app?
Does IndexDB and the LRU policy work the same in an electron app vs. a traditional web app in chrome? If so is there any supported alternative where data would be safe from being deleted?
0
votes
1answer
5 views
Auto reload changes made on React, Express Webpack with Electron
I've just finished implementing babel, webpack and postcss for compiling Reactjs, Express and tailwindscss and wrapped it with Electron. Everything works perfectly fine, but I'd like to build a script ...
0
votes
0answers
26 views
Electron electron-winstaller fails to create installers for large (filesize) app
I am trying to create a Windows installer for a electron app I am creating.
First the app is packaged with electron-packager.
exec(`npx electron-packager ./ "My App Name" --platform=win32 --...
24
votes
3answers
18k views
How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process
I'm using electron to build an application that includes two windows. I'm trying to open a second window from inside renderer process doing something like:
const electron = require('electron');
const ...
1
vote
2answers
62 views
+50
Electron: Unable to load preload script: Resources/app.asar/src/preload.js
I have an electron app that builds and runs in development, but when packaging the app with electron-builder, the preload script is not packaged in the right location.
This is a well documented issue ...
1
vote
0answers
19 views
Replacing LaTeX expressions Between Dollar Signs by Divs in Electron Application with React
Overview
Hi guys,
I'm trying to create a WYSIWYG LaTeX editor using Electron with React, but I've come across a problem while attempting to replace math expressions between dollar signs by KaTeX ...
0
votes
0answers
10 views
IpcRenderer function being called more than once in Electron React App
I want that when deleting the application with the quit on mac & windows called an api to restore some data. The problem is that the ipcRenderer is being called more than one time and I'm getting ...
1
vote
2answers
503 views
alert(__dirname) not producing any output in an electron app
I do not get the desired output when running the following electron app i.e alert box containing pwd as output. However, the commented line inside index.html seems to work fine. The developer console ...
0
votes
2answers
24 views
Expose NodeJS Methods (FS) in Electron Renderer
I am using Quasar v2 for my Electron app development.
In this version, native node modules will no longer work on the renderer processes.
To get around this, there is electron-preload.js where we can ...
0
votes
1answer
10 views
How do I use showOpenDialog withe Electron’s IPC?
I am learning to live without remote in my electron app. I have got to the point where I need to open a file from the renderer, which I understand required the main process to show the file dialog and ...
8
votes
3answers
6k views
How to access the mainWindow from another script in Electron?
My electron app defines the BrowserWindow mainWindow in the main.js. It loads an html and eventually inside of the html a script runs the function dialog.showMessageBox() which displays a simple ...
0
votes
0answers
11 views
I have not been able to get Electron running within Electron to run in WSL2 Ubuntu 20.04
I have been trying to get electron up and running on WSL2 Ubuntu 20.04 and have been mostly unsuccessful.
(Error below from terminal)
nicholaos_sofocleous@DESKTOP-8U1KGF4:~/OSP/Kafmira$ npm run start
...
0
votes
0answers
20 views
__dirname is not defined on webpack 5
I have just upgraded my environment to use Quasar v2, Electron v16 and Webpack v5. I am still on Node 12.
Before the upgrade, __dirname works fine. But then upon upgrading, then by default __dirname ...
1
vote
1answer
14 views
React history & universal-cookie not working in Electron App
I'm currently carrying over a web project over to Electron, with the use of ReactJs, Redux, Express, MongoDB & Tailwind. I'm currently stuck on my authentication, where previously I made use of ...
0
votes
0answers
10 views
Getting Code Signature Invalid when opening signed electron app
I'm dealing with this issue for almost two weeks.
When I build my electron app in a DMG file, everything works perfect, but when I try to build the app in pkg format to upload to AppStore, I get the ...
0
votes
1answer
34 views
html input not receiving barcode scanned data in electron app after production
there I am facing a problem with barcode scanned data. I am creating an app where I need to get barcode scanned data into an HTML input element. The app works in development and the HTML input receive ...
0
votes
0answers
16 views
React + Electron app not running after build
I'm currently carrying over a web app project to electron, with the use of express, mongo and redux. Previously everything was working fine when I had the express server and the mongoDB connected. So ...
1
vote
1answer
238 views
Debug Jest with Electron using VS Code
I can't manage to debug my Jest tests in VS Code when I use Electron. My tests should run with Electron, not with Node (due to the use of native modules).
{
"name": "Jest Unit Tests&...
0
votes
0answers
6 views
Electron configuration for atom-ternjs
I recently switched to atom and I'm working on an electron project. I'm relatively new to both. As auto completion, I'm using atom-ternjs. When configuring the .tern-project, I have many plugins ...
0
votes
1answer
19 views
electronJS / Detect if foreign app is running (MacOS) (Sandbox) (MAS)
Is it possible to detect in electronJS if are specific Apps are running on MacOS?
I want to check, if the Mail.app is open and its important, that the code works in Mac Apple Store (MAS) in Sandbox ...
-1
votes
0answers
15 views
electron not starting - no further information or errors
My react app with electron, dont start. I try many tutorials.
The last one was this one.
Npm run dont give any information, why it is not working.
All I have is this:
As you see, I use npm 8.3.0
And ...
0
votes
0answers
24 views
electron app looks like windows 7 window on startup
basically I've noticed with newer versions of electron when I startup any of my apps they do this window 7 border look then when everything is loaded it'll load correctly.
I don't know if this a ...
0
votes
1answer
38 views
How to retrieve value from process.on in nodejs?
The current code that I am using:
async function MainFunction(){
let arrOO;
process.on('message', (jData) => {
let sName;
if(jData.koota){
...
0
votes
0answers
14 views
issues Migrating React website to Electron with react-router-dom
I could use some help on a react-router issue. I'm trying to migrate a react web app into electron. I'm using this guide. and I get to the step of BrowserRouter
https://javascript.plainenglish.io/...
1
vote
1answer
40 views
Create an Electron nativeImage from an ES6 imported file?
We're trying to improve our build system to rely less on relative path imports, and one area we need to work on this for is image loading. So we're trying to do something like this, loading the images ...
0
votes
0answers
28 views
Could not create listener with electron.ipcRenderer.on
After creating an electron application with
npm install create-electron-app -g
create-electron-app "Electron App"
an event listener was added to index.html by placing this script tag at the ...
0
votes
0answers
27 views
Windows 10 WSL2 - Electron App via X-Server with blank screen
I want to run my Electron Apps in version 16 on Ubuntu with WSL2 and x-server (VcXsrv). The application opens under Windows 10, but unfortunately the screen is blank. Even if I just start the Electron ...
-5
votes
0answers
17 views
Basic guidelines/tips for creating a custom electron extension system [closed]
I'm working on a simple electron app, right now my main focus is adding a vscode-like extension system (albeit somewhat simpler), however I'm a bit lost.
Is there a somewhat common procedure for ...
49
votes
12answers
66k 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 ...
36
votes
4answers
31k views
electron package: reduce the package size
I made a simple Electron app:
main.js
const {app, BrowserWindow} = require('electron')
const path = require('path')
const url = require('url')
let win
function createWindow () {
win = new ...
-3
votes
2answers
86 views
What is the correct way add a protocol to the macOS info.plist using electron-builder?
I need to be able to launch my Electron app from the the browser (like sign in to Slack does). I know that I can add my protocol name to my Electron app using app.setAsDefaultProtocolClient(protocol[, ...
1
vote
1answer
18 views
Button onclick event with electron.js
So, I have an electron app, and I want to execute shell command on button click. I can't really find any helpful tips. Thanks.
0
votes
0answers
8 views
React electron app - webpack-sources maximum call stack size exceeded
I am working on an Electron Desktop app based on the electron-react-boilerplate. As expected, I'm locally starting up the application using npm start. However, at some point I occasionally started ...
0
votes
1answer
28 views
Electron - throttle flow of messages from main to render process
I am currently having some issues receiving an constant stream of active windows from my main process to my renderer process (in Angular). I know receiving second-by-second updates will break my app ...
0
votes
1answer
32 views
Could Python Subprocess.Popen handle/ignore ENOENT error on Electron app launch and proceed ahead without fail as in command line
subprocess.open throws error spawn ./jre/bin/java ENOENT exception
import subprocess
subprocess.run([r"C:\Users\<user>\AppData\Local\Programs\<some_dir>\<some_tool>.exe", &...
2
votes
1answer
41 views
UnhandledPromiseRejectionWarning: Error: Protocol error (Page.navigate): Cannot navigate to invalid URL when I am passing valid URLS
I am trying to use a puppeteer to scrape the product title of an amazon item in an electron app.
The exact test url I am using is
https://www.amazon.ca/gp/product/B088CK6GP1?pf_rd_r=...
2
votes
0answers
31 views
Electron hardware access returns wrong output, but why?
Im trying to log some of the device's hardware information in the console but it simply wont work. It outputs a way to big amount for RAM and os.cpus() returns an empty array. Any ideas why? (Im using ...
0
votes
1answer
27 views
How do I pass a variable from parent to forked child process?
My parent process forks the child as so:
child = new fork('child.js');
Now in my parent process, I have a variable that contains an array. I want to pass this array to the child process so I have ...
0
votes
0answers
10 views
What are the steps to build Microsoft Photosynth viewer? (an Electron app from 2016) [closed]
https://github.com/photosynth/offlineViewer
As the title says, what are the steps? This is just to view old photos.
I have ran into quite a lot of errors since I have zero experience with this. I don'...
0
votes
0answers
6 views
Using remote in modern Electron
In my Electron render process I have used:
const electron=require('electron');
const { ipcRenderer, shell, remote } = electron;
const {app,BrowserWindow,dialog,Menu,MenuItem}=remote;
Since upgrading ...
0
votes
0answers
25 views
ms access db connection in node.js
I am trying to connect to an Access database with nuintun's node-adodb package. I have successfully connected to it in my laptop @ home and created a dist. package to install it to my computer @ ...
0
votes
1answer
43 views
FS - Use FS for Electron on Webpack 5
I recently upgraded my Quasar framework to v2 which uses Vue3, Electron 16 and Webpack 5.
When I tried to run my application, I keep getting this error:
Module not found: Can't resolve imported ...
0
votes
0answers
7 views
devtron: TypeError: electron.BrowserWindow.addDevToolsExtension is not a function
Please help me, thanks
package.json
"devDependencies": {
"devtron": "^1.4.0",
"electron": "^16.0.2",
"electron-builder": "^...
0
votes
0answers
75 views
how to integrate sqlite3 with Angular11 + Electron
I'm trying to develop a cross-platform desktop app using electron and angular. I'm new to all this environment and I am struggling to find a way to integrate a sqlite database.
I use the maximegris/...
0
votes
0answers
10 views
How does electron realize the function of executing commands?
Ask a question, electron how to encapsulate commands, for example, the user executes the "test-cli" command, then calls a JS in the main process, and the JS in the main process will not be ...
0
votes
0answers
21 views
ERRO DE NODE_MODULE_VERSION
I have a error, inside project Node_MODULE_VERSION is 82, but outside a project Node_MODULE_VERSION is 93, how can i fix it?
i already downgrade and upgrade, but none of it works.
Outsidea project
{
...
4
votes
5answers
202 views
Intercept WebSocket messages
With ajax requests it can be done with this code:
let oldXHROpen = window.XMLHttpRequest.prototype.open;
window.lastXhr = '';
window.XMLHttpRequest.prototype.open = function(method, url, async, user, ...
0
votes
1answer
45 views
Problem while packaging application with electron-forge "EPERM operation not permitted RMDIR"
It's been a while when I last successfully packaged a electron-forge application, so I had to repackage due to a icon change. As I tried to run npm run make OR npm run package, as the command line was ...