Author: tayyaba

  • BrowserView

    Note The BrowserView class is deprecated, and replaced by the new WebContentsView class. A BrowserView can be used to embed additional web content into a BrowserWindow. It is like a child window, except that it is positioned relative to its owning window. It is meant to be an alternative to the webview tag. Class: BrowserView​ Create and control views. Note The BrowserView class is deprecated, and replaced by…

  • BaseWindow

    Create and control windows. Process: Main Note BaseWindow provides a flexible way to compose multiple web views in a single window. For windows with only a single, full-size web view, the BrowserWindow class may be a simpler option. This module cannot be used until the ready event of the app module is emitted. Parent and child windows​ By using parent option, you can create child windows:…

  • AutoUpdater

    Enable apps to automatically update themselves. Process: Main See also: A detailed guide about how to implement updates in your application. autoUpdater is an EventEmitter. Platform Notices​ Currently, only macOS and Windows are supported. There is no built-in support for auto-updater on Linux, so it is recommended to use the distribution’s package manager to update your app. In addition,…

  • App

    Control your application’s event lifecycle. Process: Main The following example shows how to quit the application when the last window is closed: Events​ The app object emits the following events: Event: ‘will-finish-launching’​ Emitted when the application has finished basic startup. On Windows and Linux, the will-finish-launching event is the same as the ready event; on macOS, this event represents the applicationWillFinishLaunching notification of NSApplication. In…

  •  Resources

    We have used the following resources to learn more about Electron. We have referred to these while creating this tutorial. The most important resource is the Electron documentation. The Documentation has extensive coverage of almost all features and quirks of the framework. They are alone enough to make your way through building an app. There are also…

  • Packaging Apps

    Packaging and distributing apps is an integral part of the development process of a desktop application. Since Electron is a cross-platform desktop application development framework, packaging and distribution of apps for all the platforms should also be a seamless experience. The electron community has created a project, electron-packager that takes care of the same for us. It…

  • Debugging

    We have two processes that run our application – the main process and the renderer process. Since the renderer process is the one being executed in our browser window, we can use the Chrome Devtools to debug it. To open DevTools, use the shortcut “Ctrl+Shift+I” or the <F12> key. You can check out how to…

  • Environment Variables

    Environment Variables control application configuration and behavior without changing code. Certain Electron behaviors are controlled by environment variables because they are initialized earlier than the command line flags and the app’s code. There are two kinds of environment variables encoded in electron – Production variables and Development variables. Production Variables The following environment variables are intended for use…

  • Defining Shortcuts

    We typically have memorized certain shortcuts for all the apps that we use on our PC daily. To make your applications feel intuitive and easily accessible to the user, you must allow the user to use shortcuts. We will use the globalShortcut module to define shortcuts in our app. Note that Accelerators are Strings that can contain…

  • Audio and Video Capturing

    Audio and video capturing are important characteristics if you are building apps for screen sharing, voice memos, etc. They are also useful if you require an application to capture the profile picture. We will be using the getUserMedia HTML5 API for capturing audio and video streams with Electron. Let us first set up our main process in…