Our window has no quit button,... Note

Our window has no quit button, and window-all-closed is an empty function

Notifio is a desktop application designed to notify users instantly about new rental listings via email. Its core value lies in its continuous operation, meaning it must never stop unexpectedly. Electron's default behavior, where closing the last window exits the app, is incompatible with this requirement. Therefore, Notifio implements a custom lifecycle, ensuring the application remains active in the system tray even when its main window is closed. A boolean flag controls whether closing the window hides it or quits the application, preventing accidental termination. The tray icon becomes the sole interface for quitting the application and informs users that it is still running. Clicking the tray icon toggles the visibility of the main window, as hiding is the default state.The application also enforces a single instance lock to prevent duplicate processes, which would lead to inefficient polling and conflicting states. Launching the app again while it's running simply brings the hidden window to the foreground, rather than starting a new instance. Sleep mode poses a challenge as browser contexts within Electron can become invalid after suspension. Notifio proactively closes these contexts before the system sleeps, ensuring they are re-initialized upon return.To prevent external websites from opening within Notifio’s own browser instance, it uses handlers to redirect all external links to the user's default browser. This is crucial for rental sites, as unauthenticated browsing would lead to login walls. In case of startup failures, which are more common in packaged apps, Notifio displays a simplified fallback window with error details and a link to the log file. This window is deliberately basic, containing only essential information to aid in troubleshooting. Uncaught exceptions and unhandled rejections are logged to ensure comprehensive error tracking. The application provides separate builds for different operating systems and clearly explains its tray behavior and background polling to users.