Build a Desktop App with Electron... But Should You?
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they were following when they hit errors, mostly because its 2020 code relies on Electron's now-deprecated remote module and old security defaults.
Recommended by 1 people across 1 different months, 2020 to 2024.
What it is
A Fireship tutorial that builds a desktop screen recorder with Electron and JavaScript in about 10 minutes, installable on Mac, Windows or Linux. It also weighs the pros and cons of choosing Electron for desktop apps.
What people said
Recommends Nishant Jha · 2021-05 · Stack Overflow · on “In electron since the 'remote' has been deprecated, what module to use in place of it?”
I am trying to make a video recording app using electron js as per this video from fireship - [this video] and I'm stuck at building a selection menu of available video sources, as it turned out that the "remote" module has been deprecated. I have 2 js files, one is index.js which is the main electron js file and the other is the render.js file (in which I'm building functions for my app). I tried importing "remote" module in the index.js file but that didn't work. I even set the enableRemoteModule: true in webPreferences in index.js but that too didn't work. Now I am completely out of ideas as a newbie. I heard about the ipcRenderer and ipcMain modules but not sure they will work. Below is the c
Cites Usman Sabuwala · 2020-05 · Stack Overflow · on “Recording and saving audio file becomes weird”
I was trying to follow one tutorial in which he made the screen recorder. He saved the file in webm format and the same thing is happening with his project: I see the video's progressbar is not going ahead and also the time looks somewhat weird. I think it is the default behaviour when you save the file. video [this video] . You can see the video player is a bit weird.
Cites Roaming Status · 2020-12 · Stack Overflow · on “Electron property inacessible in render.js”
I'm trying to learn how to build electron apps and I found this Youtube tutorial Build a Desktop App with Electron... But Should You? [this video] on building a simple screen recording app but i encountered this error Uncaught TypeError: Cannot destructure property 'Menu' of 'remote' as it is undefined. at render.js:9 Here is the exact code from the tutorial code const videoElement = document.querySelector('video'); const startBtn = document.getElementById('startBtn'); const stopBtn = document.getElementById('stopBtn'); const videoSelectBtn = document.getElementById('videoSelectBtn'); videoSelectBtn.onclick = getVideoSources; const {desktopCapturer,remote} = require('electron'); const {Menu} = re
Cites Tyrcnex · 2021-11 · Stack Overflow · on “Electron Auto-typer typing slow when not in app”
I'm making an Electron auto-typer, and I'm using the module @nut-tree/nut-js to do my auto-typing. I watched Fireship's video [this video] on setting up the electron app. Then, I created a file called typer.js and referenced it in HTML. To test the auto-typer, I created a button in the HTML file to initialize the script (button has an ID of lol , don't ask). I then tested my auto-typer in (1) a text box in the HTML file and (2) a document in my browser. The code works fine in the app. However, when I test it in my browser, it types the words really slowly. It should type a letter every 15 milliseconds, but in the browser it's more like a letter every second. Here's the code: HTML: <!DOCTYPE html>
Cites Coder · 2022-08 · Stack Overflow · on “Uncaught TypeError: Cannot read properties of null (reading 'onclick')”
I am getting an error: Uncaught TypeError: Cannot read properties of null (reading 'onclick') on following this: [this video] Here is the main.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Hello World!</title> <link rel="stylesheet" href=" [LINK] "> <link rel="stylesheet" href="index.css" /> <script defer src="render.js"></script> </head> <body> <h1>Electron recorder</h1> <video></video> <button id="startBtn" class="button is-primary"></button> <button id="stopBtn" class="button is-warning"></button> <hr /> <button id="videoSelectionBtn" class="button is-text"></button> </body> </html> And in render.js , following lines seems buggy: console.log(videoSelectionBtn) // prints NU
Cites anh010 · 2023-10 · Stack Overflow · on “Electron desktop capturer undefined in the render process”
I'm new to Electron and trying to follow the steps outlined in this tutorial here [this video] . My primary challenge appears to be encountering an undefined issue with the desktop capturer in the render process. I understand that the video is old, and some features may not work exactly as described in the tutorial, such as enabling remote (which I'm also unsure if I fixed correctly) and context isolation. Currently, my files are structured as follows: html.index <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Electron Screen Recorder</title> <link rel="stylesheet" href=" [LINK] "> <link rel="stylesheet" href="index.css" /> <script defer src="renderer.js"></script> </head> <body> <h
Cites Ctmax · 2024-10 · Stack Overflow · on “ElectronJs require is not defined”
I am trying to make an video recording software following tutorial [this video] <!--index.html--> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> <title>Hello World!</title> </head> <body> <h1>Hello World!</h1> <script defer src="./renderer.js"></script> </body> </html> // index.js const { app, BrowserWindow } = require('electron'); const path = require('node:path'); // Handle creating/removing shortcuts on Windows when installing/uninstalling. if (require('electron-squirrel-startup')) { app.quit(); } const createWindow = () => { // Create the browser window. const mainWindow = new BrowserWi