Header menu logo fable-electron-docs-api

App Module

Types and nested modules

Type/Module Description

ChildProcessGone

ConfigureHostResolver

ContinueActivity

Focus

GetFileIcon

GetLoginItemSettings (Module)

ImportCertificate

Login

MoveToApplicationsFolder

Relaunch

SetAboutPanelOptions

SetClientCertRequestPasswordHandler

SetLoginItemSettings

GetApplicationInfoForProtocol

GetJumpListSettings

GetLoginItemSettings (Type)

IOnAccessibilitySupportChanged

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when Chrome's accessibility support changes. This event fires when assistive technologies, such as screen readers, are enabled or disabled. See https://www.chromium.org/developers/design-documents/accessibility for more details.

IOnActivate

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the application is activated. Various actions can trigger this event, such as launching the application for the first time, attempting to re-launch the application when it's already running, or clicking on the application's dock or taskbar icon.

IOnActivityWasContinued

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted during Handoff after an activity from this device was successfully resumed on another one.

IOnBrowserWindowBlur

Emitted when a browserWindow gets blurred.

IOnBrowserWindowCreated

Emitted when a new browserWindow is created.

IOnBrowserWindowFocus

Emitted when a browserWindow gets focused.

IOnCertificateError

Emitted when failed to verify the certificate for url, to trust the certificate you should prevent the default behavior with event.preventDefault() and call callback(true).

IOnChildProcessGone

Emitted when the child process unexpectedly disappears. This is normally because it was crashed or killed. It does not include renderer processes.

IOnContinueActivity

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted during Handoff when an activity from a different device wants to be resumed. You should call event.preventDefault() if you want to handle this event.A user activity can be continued only in an app that has the same developer Team ID as the activity's source app and that supports the activity's type. Supported activity types are specified in the app's Info.plist under the NSUserActivityTypes key.

IOnContinueActivityError

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted during Handoff when an activity from a different device fails to be resumed.

IOnLogin

Emitted when webContents or Utility process wants to do basic auth.The default behavior is to cancel all authentications. To override this you should prevent the default behavior with event.preventDefault() and call callback(username, password) with the credentials.If callback is called without a username or password, the authentication request will be cancelled and the authentication error will be returned to the page.

IOnOpenFile

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the user wants to open a file with the application. The open-file event is usually emitted when the application is already open and the OS wants to reuse the application to open the file. open-file is also emitted when a file is dropped onto the dock and the application is not yet running. Make sure to listen for the open-file event very early in your application startup to handle this case (even before the ready event is emitted).You should call event.preventDefault() if you want to handle this event.On Windows, you have to parse process.argv (in the main process) to get the filepath.

IOnOpenUrl

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the user wants to open a URL with the application. Your application's Info.plist file must define the URL scheme within the CFBundleURLTypes key, and set NSPrincipalClass to AtomApplication.As with the open-file event, be sure to register a listener for the open-url event early in your application startup to detect if the application is being opened to handle a URL. If you register the listener in response to a ready event, you'll miss URLs that trigger the launch of your application.

IOnQuit

Emitted when the application is quitting.> [!NOTE] On Windows, this event will not be emitted if the app is closed due to a shutdown/restart of the system or a user logout.

IOnReady

Emitted once, when Electron has finished initializing. On macOS, launchInfo holds the userInfo of the NSUserNotification or information from UNNotificationResponse that was used to open the application, if it was launched from Notification Center. You can also call app.isReady() to check if this event has already fired and app.whenReady() to get a Promise that is fulfilled when Electron is initialized.> [!NOTE] The ready event is only fired after the main process has finished running the first tick of the event loop. If an Electron API needs to be called before the ready event, ensure that it is called synchronously in the top-level context of the main process.

IOnRenderProcessGone

Emitted when the renderer process unexpectedly disappears. This is normally because it was crashed or killed.

IOnSecondInstance

This event will be emitted inside the primary instance of your application when a second instance has been executed and calls app.requestSingleInstanceLock().argv is an Array of the second instance's command line arguments, and workingDirectory is its current working directory. Usually applications respond to this by making their primary window focused and non-minimized.> [!NOTE] argv will not be exactly the same list of arguments as those passed to the second instance. The order might change and additional arguments might be appended. If you need to maintain the exact same arguments, it's advised to use additionalData instead.> [!NOTE] If the second instance is started by a different user than the first, the argv array will not include the arguments.This event is guaranteed to be emitted after the ready event of app gets emitted.> [!NOTE] Extra command line arguments might be added by Chromium, such as --original-process-start-time.

IOnSelectClientCertificate

Emitted when a client certificate is requested.The url corresponds to the navigation entry requesting the client certificate and callback can be called with an entry filtered from the list. Using event.preventDefault() prevents the application from using the first certificate from the store.

IOnUpdateActivityState

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when Handoff is about to be resumed on another device. If you need to update the state to be transferred, you should call event.preventDefault() immediately, construct a new userInfo dictionary and call app.updateCurrentActivity() in a timely manner. Otherwise, the operation will fail and continue-activity-error will be called.

IOnWebContentsCreated

Emitted when a new webContents is created.

IOnWillContinueActivity

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted during Handoff before an activity from a different device wants to be resumed. You should call event.preventDefault() if you want to handle this event.

Type something to start searching.