On Windows, you have to parse process.argv (in the main process) to get theĮmitted when the user wants to open a URL with the application. You should call event.preventDefault() if you want to handle this event. Handle this case (even before the ready event is emitted). To listen for the open-file event very early in your application startup to open-file is also emitted when aįile is dropped onto the dock and the application is not yet running. To reuse the application to open the file. The open-fileĮvent is usually emitted when the application is already open and the OS wants Event: 'open-file' macOS Įmitted when the user wants to open a file with the application. To a shutdown/restart of the system or a user logout. Event: 'quit' Įmitted when the application is quitting. The will-quit and window-all-closed events. See the description of the window-all-closed event for the differences between Event: 'will-quit' Įmitted when all windows have been closed and the application will quit. Note: On Windows, this event will not be emitted if the app is closed due Then before-quit is emitted after emitting close event on all windows and Note: If application quit was initiated by autoUpdater.quitAndInstall(), Will-quit event, and in this case the window-all-closed event would not beĮmitted before the application starts closing its windows.Ĭalling event.preventDefault() will prevent the default behavior, which is If the user pressed Cmd + Q, or the developer calledĪpp.quit(), Electron will first try to close all the windows and then emit the If you do not subscribe to this event and all windows are closed, the defaultīehavior is to quit the app however, if you subscribe, you control whether theĪpp quits or not. Event: 'window-all-closed' Įmitted when all windows have been closed. To get a Promise that is fulfilled when Electron is initialized. You can also call app.isReady() to check if this event has already fired and app.whenReady() That was used to open the application, if it was launched from Notification Center. Or information from UNNotificationResponse Holds the userInfo of the NSUserNotification launchInfo Record | NotificationResponse macOSĮmitted once, when Electron has finished initializing.In most cases, you should do everything in the ready event handler. This event represents the applicationWillFinishLaunching notification of The will-finish-launching event is the same as the ready event on macOS, The app object emits the following events: Event: 'will-finish-launching' Įmitted when the application has finished basic startup.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |