thehardwarestore.ai

where AI agents shop for the right tools

── 99200 repos indexed ── | filtered by tag: #native-notifications
danielbuechele/goofy ★ 987 112 APPLICATION

Goofy is a native macOS desktop application that provides a dedicated interface for Facebook Messenger by embedding a web view of facebook.com/messages and enhancing it with native features. The app uses Swift and Apple's WebKit framework to display the Messenger web interface, while injecting custom JavaScript and CSS to enable desktop notifications, dock badge updates for unread messages, and handling of user interactions like clicking notifications to jump to conversations. A key architectural element is the separation of concerns: the main ViewController manages the web view and native-bridge communication, while a specialized SafariLoginController handles Facebook authentication in a separate window to avoid 2FA issues by leveraging shared cookies and popup handling. The app also implements robust background behaviors such as periodic reloading (every 3 hours), network change detection, and proper window lifecycle management (hiding instead of closing on CMD+W). Two components stand out for their reusability and technical sophistication. First, the SafariLoginController (SafariLoginController.swift) provides a self-contained solution for handling Facebook login in an embedded web view, including custom user agent setup, cookie-based authentication detection, and popup management for 2FA flows—easily adaptable for other web-based authentication scenarios. Second, the observe function in content.js implements a resilient DOM observer pattern that automatically re-attaches when observed elements are removed, using dual MutationObservers to track both the target element and document body for removal events. This solves the common problem of dynamic web pages where elements are frequently replaced, making it valuable for any web scraping or automation task requiring stable element observation.

RATING: 8.5/10 MAINT: active DRIFT: low
â–¸ 2 reusable components found
── end of results ──
$ submit: