A minimal macOS agent app that intercepts all HTTP/HTTPS URLs, copies them to clipboard, and shows a dialog. No network requests, no data stored on disk.
| Feature | Detail |
|---|---|
| App type | Background agent (no Dock icon) via LSUIElement |
| URL handling | Registers as default web browser for http/https and intercepts all links |
| User feedback | Alert dialog with selectable URL text |
| Preferences | Boolean toggles via status-bar menu |
| Network | Zero network requests |
| Disk storage | None (only UserDefaults booleans) |
- macOS 12+ (Monterey or later)
- Xcode Command Line Tools:
xcode-select --install
git clone https://github.com/Neison32/link-catcher-macos.git
cd link-catcher-macos
make build
make installThe built app bundle appears at build/LinkCatcher.app.
make install copies it to /Applications/, registers it with Launch Services, and prints a reminder to set it as the default browser.
Note: The build uses a
vfs-overlay.yamlto work around a known CLT bug whereSwiftBridgingmodule is defined twice. If you have full Xcode installed, you can remove-vfsoverlay vfs-overlay.yamlfrom the Makefile.
| Command | What it does |
|---|---|
make build |
Compiles Swift sources into build/LinkCatcher.app |
make icon ICON=/abs/path/icon.jpeg |
Generates Resources/AppIcon.icns from a JPEG/PNG |
make install |
Copies the built app to /Applications/ and registers it with Launch Services |
make uninstall |
Removes the app from /Applications/ |
make clean |
Deletes the build/ directory |
After making changes to the source code, run the full update cycle:
make clean # Remove old build artifacts
make build # Compile the updated sources
make install # Copy the new build to /ApplicationsWhen do I need to rebuild? Only when you change
.swiftfiles,Info.plist, orvfs-overlay.yaml. Changes toREADME.md,LICENSE, or.gitignoredo not require a rebuild.
To completely remove the app:
make uninstall- Open System Settings
- Go to Desktop & Dock
- Find Default web browser
- Select Link Catcher
You may need to restart System Settings or log out/in for Link Catcher to appear in the list.
Once set as default browser, every URL opened on your Mac flows through Link Catcher:
- All URLs are intercepted by default — a dialog is shown with the URL and it is auto-copied to clipboard.
When you open Link Catcher directly (from Finder, Spotlight, or the Dock) without an incoming URL, a welcome dialog appears explaining how the app works. It also offers a shortcut to open System Settings so you can set Link Catcher as your default browser.
When a URL is intercepted, a modal dialog appears with:
- A title: "🔗 Link Intercepted"
- A scrollable, selectable text field showing the full URL (monospaced font)
- Two buttons:
- OK — dismisses the dialog
- Open in Safari — opens the URL in Safari (or Chrome as fallback)
The app temporarily shows in the Dock while the dialog is open, then hides again.
# Should intercept → clipboard + dialog
open "https://accounts.google.com/o/oauth2/auth?client_id=test&redirect_uri=http://localhost"
# Also intercepted
open "https://example.com"A 🔗 icon (or SF Symbol link.badge.plus) in the menu bar provides toggles:
| Menu Item | Default | Effect |
|---|---|---|
| Auto-Copy URL to Clipboard | ✅ ON | Copy intercepted URLs to clipboard on arrival |
| How It Works… | — | Shows the welcome/info dialog |
| Quit Link Catcher | — | Terminates the agent |
Tip: The app always uses dialog mode so the full URL is visible and selectable every time.
- Open System Settings
- Go to Desktop & Dock
- Change Default web browser back to Safari or Google Chrome
To fully remove the app, run make uninstall (see Makefile Commands above).
Sources/
├── main.swift # App bootstrap (NSApplication, accessory mode)
├── AppDelegate.swift # URL handling, clipboard, dialogs
└── StatusBarController.swift # Menu bar status item + preference toggles
Resources/
└── Info.plist # Bundle config, URL schemes, LSUIElement
Makefile # build, install, uninstall, clean targets
vfs-overlay.yaml # CLT module-map fix (can remove with full Xcode)
None required. The app uses only public macOS APIs:
NSPasteboard— clipboardNSWorkspace— open URLs in Safari/ChromeNSStatusItem— menu bar iconNSAlert— modal dialog with selectable URL text
macOS opens http/https URL
│
▼
Link Catcher receives URL(s)
via application(_:open:)
│
▼
Auto-copy to clipboard
(if enabled)
│
▼
Show alert dialog
with selectable URL
MIT