An intelligent Firefox browser extension that monitors your browsing activity and helps you stay focused by detecting distractions and gently guiding you back on track.
- Real-time Distraction Detection: Monitors your browsing and identifies when you visit distracting websites
- Smart Notifications: Sends friendly alerts when you've been distracted for too long
- Customizable Focus Domains: Define your work/study sites to stay on track
- Productive & Distracting Patterns: Configure keywords and URL patterns to categorize sites
- Session Tracking: Track your focus time, distractions, and current site category
- Flexible Settings: Customize alert thresholds, notification preferences, and more
- Beautiful UI: Clean, modern interface with gradient design
- Monitoring: The extension continuously monitors which tabs you visit and how long you spend on each site
- Categorization: Each site is categorized as:
- π― Focus: Your designated work/study domains
- β Productive: Sites with productive keywords (docs, tutorials, etc.)
- β Neutral: Regular sites
β οΈ Distracting: Entertainment, social media, and other time-wasters
- Alerts: When you spend too long on distracting sites, you'll receive a notification
- Stats: Track your session time, distraction count, and current focus status
- Open Firefox and navigate to
about:debugging - Click "This Firefox" in the left sidebar
- Click "Load Temporary Add-on"
- Navigate to the extension directory and select
manifest.json - The extension is now loaded temporarily (will be removed when Firefox closes)
- Open Firefox and navigate to
about:config - Search for
xpinstall.signatures.required - Set it to
false(this allows unsigned extensions) - Package the extension:
cd /path/to/extension zip -r ai-focus-agent.zip *
- Navigate to
about:addonsin Firefox - Click the gear icon and select "Install Add-on From File"
- Select the
ai-focus-agent.zipfile
# Install web-ext if you haven't already
npm install -g web-ext
# Run the extension in a temporary Firefox instance
cd /path/to/extension
web-ext run
# Or build and sign for distribution
web-ext build- Click the extension icon in your toolbar to open the popup
- Add focus domains: Type domains like
github.comorstackoverflow.comwhere you want to stay focused - Browse normally: The extension will monitor your activity in the background
- Get notified: When you get distracted, you'll receive a friendly notification
Click "Settings" in the popup to access detailed configuration:
- Distraction Alert Threshold: Set how long (in seconds) you can stay on a distracting site before getting alerted
- Focus Session Duration: Set your ideal focus session length (Pomodoro-style)
- Enable Notifications: Toggle browser notifications on/off
- Productive Keywords: Add keywords that indicate productive sites (e.g., "documentation", "tutorial", "learning")
- Distracting Patterns: Add URL patterns or domains that are distracting (e.g., "youtube.com/watch", "reddit.com")
- Focus Domains: Add your primary work/study domains
- Session Time: How long your current focus session has been running
- Distractions: Number of times you've been alerted this session
- Current Site: The category of the site you're currently on
- Status Message: Real-time feedback on your focus state
The extension escalates its messages based on consecutive distractions:
- First distraction: Gentle reminder
- Second distraction: Suggests taking a real break
- Multiple distractions: More urgent messages about patterns
The extension comes pre-configured with common distracting sites:
- Social media: Facebook, Twitter, Instagram, TikTok, Reddit
- Video streaming: YouTube (watch pages), Netflix, Twitch
- News and sports sites
- Gaming sites
You can customize this list in the settings!
Sites containing these keywords are marked as productive:
- github
- stackoverflow
- documentation / docs
- learn / learning
- tutorial
- course
This extension:
- β Runs entirely locally on your machine
- β Does NOT send any data to external servers
- β Does NOT track your browsing history beyond the current session
- β Stores settings locally in Firefox's storage
- β Only monitors tab URLs and timing, not page content
ai-focus-agent/
βββ manifest.json # Extension configuration
βββ background.js # Core monitoring logic
βββ icons/ # Extension icons
β βββ icon-48.png
β βββ icon-96.png
βββ popup/ # Popup interface
β βββ popup.html
β βββ popup.css
β βββ popup.js
βββ options/ # Settings page
βββ options.html
βββ options.css
βββ options.js
- background.js: Main logic for tab monitoring, site categorization, and notification triggers
- popup: Quick access interface for focus domains and session stats
- options: Detailed configuration page for all settings
- Pure JavaScript (no frameworks)
- WebExtensions API
- Firefox Browser APIs (tabs, notifications, storage, alarms)
- Check Firefox notification permissions:
about:preferences#privacy - Ensure notifications are enabled in the extension settings
- Check your OS notification settings
- Check browser console for errors:
about:debugging> Inspect - Ensure all files are present in the extension directory
- Verify manifest.json syntax is valid
- Open Settings and check your patterns
- Add specific domains to Focus Domains for accurate tracking
- Remember: patterns are case-insensitive and use substring matching
- Block distracting sites in strict mode
- Focus session timer with breaks
- Weekly/monthly analytics and reports
- Whitelist specific YouTube channels or Reddit communities
- Integration with productivity techniques (Pomodoro, time-blocking)
- Export focus statistics
- AI-powered pattern learning from your behavior
This is an open-source project. Contributions are welcome!
MIT License - feel free to use and modify as needed.
If you encounter issues or have suggestions, please open an issue on the project repository.
Made with π by developers who also struggle to stay focused!