A Chrome extension that prevents opening duplicate tabs for specific websites, helping you stay focused and reduce tab clutter.
- Smart Duplicate Detection: Automatically detects when you try to open a duplicate tab for watched domains
- Friendly Intervention: Shows a helpful prompt when a duplicate is detected, allowing you to:
- Switch to the existing tab
- Open anyway (bypass the restriction for that session)
- Custom Watchlist: Easily manage which domains should be limited to one tab
- Lightweight: Minimal performance impact with efficient tab monitoring
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the project directory
- The extension icon should now appear in your toolbar
- Click the extension icon in your toolbar
- Navigate to the website you want to limit
- Click "Limit this Domain" in the popup
- The domain will be added to your watchlist
- Click the extension icon to open the popup
- View all domains currently on your watchlist
- Click "Remove" next to any domain to stop watching it
When you try to open a tab for a watched domain that's already open:
- You'll see an intervention page with two options:
- Switch to Existing Tab: Closes the new tab and focuses the existing one
- Open Anyway: Bypasses the restriction for this session
The extension uses Chrome's tabs API to monitor navigation events. When you navigate to a URL:
- Checks if the domain is in your watchlist
- Searches for other open tabs with the same domain
- If a duplicate is found, shows an intervention page
- Stores bypass permissions per-tab to allow temporary exceptions
manifest.json- Extension configurationbackground.js- Service worker that monitors tabs and enforces the one-tab rulepopup.html/js- Extension popup UI for managing the watchlistintervention.html/js- Intervention page shown when duplicates are detectedstyle.css- Shared styles for popup and intervention pages
The extension requires the following permissions:
- tabs: To monitor and manage open tabs
- storage: To save your watchlist preferences
- webNavigation: To detect when you navigate to new URLs
one-tab-only/
├── manifest.json # Extension manifest (Manifest V3)
├── background.js # Background service worker
├── popup.html # Extension popup interface
├── popup.js # Popup logic
├── intervention.html # Duplicate tab warning page
├── intervention.js # Intervention page logic
└── style.css # Shared styles
checkOneTabRule()in background.js:35 - Main logic for detecting and handling duplicatesaddToWatchlist()in popup.js:22 - Adds domains to the watchlistremoveFromWatchlist()in popup.js:33 - Removes domains from the watchlist
This project is open source and available for personal use.
Contributions are welcome! Feel free to submit issues or pull requests.