Build a Desktop App with Electron… But Should You?

Build a Desktop App with Electron… But Should You?

A complete beginner’s tutorial for Electron JS ⚑ along with an overview of its pros and cons. In about 10 minutes, we build a desktop screen recorder from scratch with JavaScript that is installable on Mac, Windows, or Linux.

Full Electron Tutorial: https://fireship.io/lessons/electron-screen-recorder-project-tutorial
Source Code: https://github.com/fireship-io/223-electron-screen-recorder
Electron Forge: https://www.electronforge.io/

#tutorial #javascript #electron

Install the quiz app πŸ€“

iOS https://itunes.apple.com/us/app/fireship/id1462592372?mt=8
Android https://play.google.com/store/apps/details?id=io.fireship.quizapp

Upgrade to Fireship PRO at https://fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.

My VS Code Theme

– Atom One Dark
– vscode-icons
– Fira Code Font

50 Comments

  1. Rundik on March 12, 2021 at 12:09 am

    You should add a disclaimer not to repeat this at home. We have enough electron garbage already



  2. Toh Kim Boon on March 12, 2021 at 12:11 am

    need to include enableRemoteModule: true in webPreferences for latest electron



  3. Aviruk Basak on March 12, 2021 at 12:11 am

    where did you get the Churchill quote?



  4. Surush Cyrus on March 12, 2021 at 12:11 am

    Solution/code is not working under electron: 11.2.2. Getting the following error:
    render.js:5 Uncaught TypeError: Cannot destructure property ‘dialog’ of ‘remote’ as it is undefined.
    at render.js:5



  5. Andy Holm-Jensen on March 12, 2021 at 12:13 am

    As of Electron v9 you can’t call remote on the renderer unless you set the enableRemoteModule as true on the BrowserWindow (like you did with nodeIntegration). Great tutorial nonetheless. πŸ™‚



  6. Tyrrell Davis on March 12, 2021 at 12:13 am

    Does it record audio? Could be used as a live stream clipper for long streams



  7. Simon Hallin on March 12, 2021 at 12:14 am

    OBS: Imma head out
    Fraps: Wait on me



  8. Andre Westerlund on March 12, 2021 at 12:16 am

    For anyone wondering what to attach to the start and stop buttons. Add Event handlers to startBtn and stopBtn that call mediaRecorder.start() and mediaRecorder.stop(), respectively.



  9. OussSikaVF on March 12, 2021 at 12:23 am

    pls sir can you do a full course about electron



  10. Georges Bolssens on March 12, 2021 at 12:24 am

    For security reasons, setting NodeIntegration to True is not something you should do when not absolutely needed (or when you don’t understand when it can be harmful to your users) ; there’s a reason why it’s off by default: https://www.electronjs.org/docs/tutorial/security#2-do-not-enable-nodejs-integration-for-remote-content



  11. Hooria Nasar on March 12, 2021 at 12:24 am

    wao!



  12. Soohoran on March 12, 2021 at 12:24 am

    I love electron b/c every click results in a coffee break.



  13. flerken on March 12, 2021 at 12:25 am

    I don’t know if I’m blind but I missed where and how you implemented the start and stop buttons. So I don’t have a fully functional application.



  14. Vitor LobΓ£o on March 12, 2021 at 12:29 am

    I’m going to record myself writing a joke about people joking about a guy recording himself build an electron screen recorder on an electron app.



  15. Ben Riv on March 12, 2021 at 12:31 am

    But should we learn electron or it is a bad technology???



  16. Alex Dobson on March 12, 2021 at 12:33 am

    Great tutorial, love the snappy approach… too much burble in most others. Sadly in Mac Catalina the app only records the desktop, mouse and the electron app itself … all other app windows aren’t visible in the output. The content is still awesome (despite Mac OS & API changes). Thank you!



  17. rushane kerr on March 12, 2021 at 12:33 am

    Finally found out why Vs Code runs like crap



  18. TheCodingByte on March 12, 2021 at 12:34 am

    This program wont work currently because the stop and start button onclick was never coded hahaha. However the code has been updated on GitHub. Keep up the work!



  19. Leandro Silva on March 12, 2021 at 12:34 am

    Why remove the v8 engine and build a renderer from a graphic lib on a multiplatform language like Java or Python if you can use a WHOLE web browser for the job XD… Worst architecture I have ever seen…



  20. Michael Uvarov on March 12, 2021 at 12:34 am

    You should, if you already have a web version.



  21. Chih Chang on March 12, 2021 at 12:36 am

    wait really someone prefers JavaFX???? If you eventually land on JavaFX for your application, then don’t make your application.



  22. μ„œμ§„μ„ on March 12, 2021 at 12:36 am

    For those who have issue about "TypeError" Cannot deconstruct….. require remote as it is undefined , I found a solution here
    https://stackoverflow.com/questions/63901266/electron-js-cannot-destructure-property-browserwindow-of-require-remot

    You need to add enableRemoteModule: true, to WebPreference in index.js



  23. Iquerno on March 12, 2021 at 12:36 am

    I’ve seen this being done all over the place, but is there some piece of software or website that can create these great macOS-like renders 2:29 easily? You seem to be using Windows and thus I am a bit confused how you managed to do it.
    Thanks



  24. Christofer Berruz Chungata on March 12, 2021 at 12:36 am

    Dude, you are a savior! This tutorial fits perfectly what I am trying to build! Thanks a lot



  25. ElΓ­ Benson Vasquez Hdz on March 12, 2021 at 12:37 am

    Can someone point on how to add the sound capture functionality to it?



  26. GrΓ©goire BOUX on March 12, 2021 at 12:39 am

    Excellent video, many thanks πŸ™‚
    But two things are missing in the video about remote and buttons :

    1 – 4:30 – You need to add enableRemoteModule: true in order to access the remote object in JS.
    2 – See https://fireship.io/lessons/electron-screen-recorder-project-tutorial/#record-and-save-a-video-file for the Start & Stop buttons’ onclick functions.

    Hope it will help some people πŸ˜‰



  27. Hurty18 on March 12, 2021 at 12:41 am

    Tip for the kewl people who code along: two "webPreferences" need to be added to index.js, here:

    const createWindow = () => {
    // Create the browser window.
    const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,

    webPreferences: {
    nodeIntegration: true,
    enableRemoteModule: true
    }
    });



  28. Electrex on March 12, 2021 at 12:42 am

    Wait, what if we are using Django? How does that work?



  29. KEYTRAP on March 12, 2021 at 12:45 am

    Great tutorial, very nice to watch πŸ‘



  30. mope.io on March 12, 2021 at 12:46 am

    I need to hijack Electron Packager apps to play Mope.io instead of boring actions on installing and editing.

    But it can’t



  31. Γ–mer Faruk Konca on March 12, 2021 at 12:46 am

    windowsofislam.com



  32. Paritosh Yadav on March 12, 2021 at 12:47 am

    I’m starting on a new electron project in my company and needed an introduction. This video serves the purpose. Feeling much comfortable now.



  33. Matthew thehuman on March 12, 2021 at 12:47 am

    Just love it, thanks! I can hardly imagine a more efficient introduction to electron for someone who’s already a js programmer.



  34. Ratul Saha on March 12, 2021 at 12:52 am

    when you realise that he didnt use the start and stop buttons -.-



  35. Mohammad Bilto on March 12, 2021 at 12:53 am

    Random creepy background scream at 4:10



  36. docent on March 12, 2021 at 12:56 am

    8:58 portal for me



  37. Studio 427 on March 12, 2021 at 12:56 am

    Could you please speed up the video next time? This world’s not going fast enough…



  38. blez on March 12, 2021 at 12:59 am

    "333,333" views eeeeeeevil



  39. Jhon Shephard on March 12, 2021 at 12:59 am

    ALL the others? Kivy? Qt? UWP? WPF?



  40. Tayler Allen on March 12, 2021 at 1:00 am

    Anyone know what VS Code theme he uses? Of course it’s not that important but I’d like to use it myself.



  41. Azeem Ansari on March 12, 2021 at 1:01 am

    More project based videos πŸ‘πŸ»



  42. Ghost of Henry on March 12, 2021 at 1:02 am

    Electron apps are an abomination. Also are Java, .NET, mono



  43. DK on March 12, 2021 at 1:02 am

    A similar video covering all major features of Nodejs will be great.



  44. Dev Everything on March 12, 2021 at 1:03 am

    Does it ‘compile code’ meaning is it easy for a user to change your app code to make it behave differently? How secure is electron?



  45. yann on March 12, 2021 at 1:03 am

    Thanks ! Now I know how to create a powerful screen recorder for my new virus !



  46. Wahyu Setiawan on March 12, 2021 at 1:06 am

    Talking about Electron app

    My 2013 laptop with 2gb ram: don’t even think about it



  47. flerken on March 12, 2021 at 1:07 am

    Thanks. With a help of your tutorial I was able to code the virus in electron. I now have a lot of moneys.



  48. Danilo Vilas Boas on March 12, 2021 at 1:08 am

    Please, don’t.
    Unles you are Samsung, Patriot, Corsair, GSkill or any RAM maker or sponsorship.



  49. Orr Burgel on March 12, 2021 at 1:08 am

    Is there any video explaining what is the difference between electron-forge and all the other?



  50. zool l3ab on March 12, 2021 at 1:09 am

    C#:and I took it personally