Skip to content

0xdps/default-tamer

Default Tamer

License: MIT macOS Swift

A macOS menu bar utility that intelligently routes URLs to the correct browser based on source app and URL rules.

Set Default Tamer as your default browser once; from then on, your links open where you want.

✨ Features

  • 🎯 Smart Routing: Route links based on source app (Slack, Cursor) and URL patterns
  • 🌐 Domain Rules: Send specific domains to specific browsers
  • Override Chooser: Hold Option key to manually choose browser
  • 🔄 Fallback Browser: Configurable default browser for unmatched links
  • 🚀 Launch at Login: Optionally start at system login
  • 📊 Activity Logging: Track recent routes for debugging (optional, privacy-first)
  • 🔒 Privacy First: All processing is local, no network calls
  • Production Ready: All audit fixes implemented, error handling, input validation

Installation

Download

Download the latest release from GitHub Releases

Setting as Default Browser

  1. Launch Default Tamer
  2. Click "Open System Settings" in the first-run window
  3. In System Settings → Desktop & Dock → Default web browser, select "Default Tamer"

Usage

Quick Start

  1. Set Fallback Browser: Choose which browser to use when no rules match
  2. Default Rules: Slack and Cursor links automatically open in Chrome
  3. Add Custom Rules: Click "Manage Rules..." to add domain or URL pattern rules

Rule Types

Source App Rules

Route links from specific apps to specific browsers:

  • Example: Slack → Chrome
  • Example: Cursor → Chrome

Domain Rules

Route specific domains to specific browsers:

  • Exact: github.com matches only github.com
  • Suffix: .atlassian.net matches any subdomain
  • Contains: jira matches any domain containing "jira"

URL Pattern Rules

Route based on URL content:

  • Contains: Match URLs containing specific text
  • Regex: Advanced pattern matching (optional)

Modifier Key Chooser

Hold ⌥ Option while clicking any link to show a browser chooser, allowing you to override rules for that specific link.

Architecture

Core Components

  • BrowserManager: Discovers installed browsers and handles URL opening
  • Router: Pure decision engine for rule evaluation
  • PersistenceManager: UserDefaults-based storage
  • SourceAppDetector: Best-effort source application detection
  • DiagnosticsManager: Recent routes tracking

Data Models

  • Browser: Represents an installed browser
  • Rule: Routing rule (Source App, Domain, or URL Pattern)
  • Settings: App configuration
  • RouteLog: Diagnostic log entry

Configuration

Settings are stored in UserDefaults at:

  • Settings: defaultTamer.settings
  • Rules: defaultTamer.rules

Default Rules

On first launch, two rules are created:

  1. Slack → Chrome
  2. Cursor → Chrome

Development

Project Structure

DefaultTamer/
├── Models/           # Data models
├── Services/         # Core business logic
├── Views/           # SwiftUI views
├── Utilities/       # Helper functions
└── Resources/       # Assets and configuration

Key Files

  • AppDelegate.swift: Menu bar integration and URL event handling
  • AppState.swift: Central state management
  • Router.swift: Rule evaluation logic
  • MenuBarPopover.swift: Main UI

Development Scripts

Located in scripts/ directory:

Quick Iteration (Recommended)

# Fast rebuild and deploy for UI changes
./scripts/quick-deploy.sh

Perfect for rapid UI development - builds, deploys, and launches in one command! Fresh Build & Deploy

# Complete reset, clean, build, and deploy
./scripts/fresh.sh

Use when you want a completely fresh start or after significant changes.

Building & Deployment

# Build the app
./scripts/build.sh

# Deploy to /Applications
./scripts/deploy.sh

Icon Management

# Update all app and website icons from source image
./scripts/update-icons.sh [source-image-path]

# Uses assets/default-tamer.png by default
./scripts/update-icons.sh

# Or specify custom source
./scripts/update-icons.sh my-new-icon.png

Generates:

  • 7 app icon sizes (16px to 1024px)
  • 5 website icons (favicons, logo, apple-touch-icon)

Reset & Testing

# Reset first-run flag (~85-90% accuracy)
- Requires manual setup as default browser in System Settings
- macOS 13.0+ required for Launch at Login feature
- Activity logging must be enabled in preferences to view routing history
# Reset all app data (rules, settings, first-run)
./scripts/reset.sh --all

Known Limitations

  • Source app detection is best-effort and may not work for all apps
  • Requires manual setup as default browser in System Settings
  • macOS 13.0+ required for Launch at Login feature

Privacy

Default Tamer:

  • ✅ Processes all data locally
  • ✅ Makes no network requests
  • ✅ Stores no personal information
  • ✅ Does not track user behavior

🗺️ Roadmap

See open issues for planned features and known issues.

Potential v2 features:

  • Window title / tab title routing (requires Accessibility permissions)
  • Chrome profile selection
  • Import/export rules JSON
  • "Always for this domain" from chooser
  • Per-app "always show chooser" mode
  • iCloud sync for rules

🤝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

Ways to contribute:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 📝 Improve documentation
  • 🔧 Submit pull requests
  • ⭐ Star the project

👨‍💻 For Developers

Building from Source

Prerequisites:

  • macOS 13.0+
  • Xcode 14.0+

Quick Start:

git clone https://github.com/0xdps/default-tamer.git
cd default-tamer
./scripts/quick-deploy.sh

Development Workflow

See QUICKSTART.md for complete development guide.

Common commands:

./scripts/quick-deploy.sh          # Build and test
./scripts/bump-version.sh 0.0.2    # Release new version
./scripts/monitor-logs.sh          # Debug

Documentation:


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

Built with Swift and SwiftUI for macOS.

About

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published