A lightweight cross-browser extension that automatically groups open tabs by domain, with intelligent domain name handling for better organization. Works on both Chrome and Firefox!
π¦ Firefox Add-ons π Chrome Web Store
| Browser | Version | Status |
|---|---|---|
| Firefox | 139+ | β Fully supported (Manifest V3, Tab Groups API) |
| Chrome | Latest | β Fully supported (Manifest V3, Tab Groups API) |
Note: Firefox 139+ required for full Tab Groups API support and enhanced features.
- β Cross-browser compatibility - Single codebase for Chrome and Firefox
- β Domain-based tab grouping - Automatically groups tabs by website domain
- β Custom rules - Create named groups that combine multiple domains
- β Rules export/import - Backup, share, and migrate custom rules as JSON files
- β Smart domain display - Shows clean domain names (e.g., "github" instead of "github.com")
- β Color management - Persistent group colors across browser sessions
- β Collapse/expand controls - Manage tab group visibility
- β Focus Mode - Auto-collapse inactive groups when switching tabs
- β Configuration options - Auto-grouping, subdomain handling, etc.
- β Side panel support - Chrome side panel and Firefox sidebar
- β Modern UI - Clean, responsive interface
- Automatically groups tabs by their domain/subdomain
- Smart domain name display (e.g., "github" instead of "www.github.com")
- Country code second-level domain (ccSLD) support - Properly handles domains like
calendar-uk.co.uk,example.co.uk,abc.net.au, etc. - Special handling for IP addresses, localhost, and .local domains
- Real-time group updates as you browse
- Priority System: Custom rules take priority over domain-based grouping
- Fallback: Domains not covered by custom rules still use automatic domain grouping
- Real-time: Changes to rules immediately re-group existing tabs
- Quick add from current tabs: Select domains from your currently open tabs instead of typing them manually
- Example Use Cases:
- Communication: Group
discord.com,teams.microsoft.com,slack.comunder "Communication" - Development: Group
github.com,stackoverflow.com,docs.google.comunder "Dev Tools" - Social Media: Group
twitter.com,facebook.com,instagram.comunder "Social"
- Communication: Group
- One-click collapse/expand all groups
- Real-time group updates
- Maintains existing groups without duplicates
- Group/Ungroup all tabs with one click
- Focus Mode: Automatically collapse inactive groups when switching tabs
- Consistent colors for each domain group
- Random color generation with one click
- Optional preservation of manually customized colors
- Remembers color preferences across browser sessions
- Toggle auto-grouping (on/off)
- Toggle grouping by subdomain (on/off)
- Toggle only applying to new tabs (on/off)
- Toggle preservation of manual color choices (on/off)
- Chrome side panel and Firefox sidebar integration
- Displays tab groups for easy access
- Allows quick navigation between groups
- Sidebar popup as an alternative to the main popup
- AI-powered tab grouping (In Progress):
- Utilizing WebLLM for intelligent tab grouping in the client's browser (Awesome for privacy)
- Smart grouping based on tab content, not just domain names
- Manually invoking AI for creating rules and grouping tabs based on them.
- Letting the AI to autonomously decide to group tabs, and creating rules.
- Custom Rules UI Enhancements:
- Improved user interface for managing custom rules
- Better visualization of rule priorities and conflicts
- Search Functionality:
- Search through open tabs and groups
- Filter by domain, group name, or custom rules
- Improve Security, XSS, and CSP:
- Enhanced security measures to prevent XSS attacks
- Content Security Policy (CSP) updates for better protection
The AI grouping feature is currently under active development with:
- A form of web-native LLM.
Since this is open source, to run the AI grouping feature locally, users will need to provide their own API key.
The extension is built with WXT and TypeScript, supporting both Chrome and Firefox from a unified codebase.
bun install
bun run dev # Start development server| Command | Description |
|---|---|
bun run dev |
Start WXT development server |
bun run dev:chrome |
Development server for Chrome |
bun run dev:firefox |
Development server for Firefox |
bun run build |
Build production extension (Chrome) |
bun run build:firefox |
Build production extension (Firefox) |
bun run zip |
Create release zip (Chrome) |
bun run zip:firefox |
Create release zip (Firefox) |
bun run typecheck |
Run TypeScript type checking |
bun run test |
Run unit tests (380+ tests) |
bun run lint |
Run Biome linter |
bun run format |
Format with Biome |
Chrome:
- Run
bun run dev:chrome - Go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select
.output/chrome-mv3-dev/
Firefox:
- Run
bun run dev:firefox - Go to
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Select any file in
.output/firefox-mv3-dev/
The project follows Test-Driven Development (TDD) principles with comprehensive test coverage across unit and end-to-end tests.
| Tool | Purpose |
|---|---|
| Vitest | Unit tests (fast, Vite-native) |
| Playwright | E2E browser extension testing |
bun run test # Run unit tests (380+ tests)
bun run test:e2e # Build extension and run E2E testsLocated in tests/, these test core utilities and business logic:
DomainUtils.test.ts(45 tests) - Domain extraction, ccSLD handling, edge casesUrlPatternMatcher.test.ts(27 tests) - URL pattern matching, wildcards, validation
bun run test # Run all unit tests
bun run test -- --watch # Watch mode during development
bun run test -- --coverage # Generate coverage reportLocated in tests/e2e/, these test the extension in a real browser:
extension.spec.ts- Extension loading, popup UI, toggle functionality, sidebar
E2E tests require building the extension first:
bun run test:e2e # Builds Chrome extension, then runs PlaywrightNote: E2E tests run in headed mode (visible browser) since Chrome extension testing requires it.
- Unit tests: Core utilities at 80%+ coverage
- E2E tests: Critical user flows (popup, toggle, rules)
Follow TDD workflow:
- Write test first (RED) - Define expected behavior
- Run test - Verify it fails
- Implement code (GREEN) - Minimal code to pass
- Refactor (IMPROVE) - Clean up while keeping tests green
Example unit test pattern:
import { describe, it, expect } from "vitest"
import { extractDomain } from "../utils/DomainUtils"
describe("extractDomain", () => {
it("extracts domain from standard URL", () => {
expect(extractDomain("https://github.com/user/repo")).toBe("github")
})
it("handles ccSLD domains correctly", () => {
expect(extractDomain("https://example.co.uk/page")).toBe("example")
})
})auto-tab-groups/
βββ entrypoints/ # Extension entry points (WXT)
β βββ background.ts # Service worker
β βββ popup/ # Popup UI
β β βββ index.html
β β βββ main.ts
β β βββ style.css
β βββ sidebar/ # Sidebar UI (Chrome side panel / Firefox sidebar)
β β βββ index.html
β β βββ main.ts
β βββ rules-modal.unlisted/ # Rule creation/editing modal
β βββ index.html
β βββ main.ts
β βββ style.css
βββ services/ # Business logic
β βββ TabGroupService.ts # Tab grouping logic
β βββ RulesService.ts # Custom rules management
β βββ TabGroupState.ts # State management
β βββ index.ts
βββ utils/ # Utilities
β βββ DomainUtils.ts # Domain processing with ccSLD support
β βββ UrlPatternMatcher.ts # URL pattern matching
β βββ Constants.ts # Tab group colors
β βββ RulesUtils.ts # Rule validation helpers
β βββ storage.ts # WXT storage utilities
βββ types/ # TypeScript type definitions
βββ tests/ # Unit tests (380+ tests)
βββ public/ # Static assets (icons)
βββ docs/ # Documentation
βββ wxt.config.ts # WXT configuration
βββ vitest.config.ts # Vitest configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json
The extension works automatically in the background, grouping tabs by domain with intelligent name formatting. Click the extension icon in the browser toolbar to:
- Toggle automatic grouping
- Configure grouping options
- Manually trigger grouping for all tabs
- Generate new random colors for groups
- Collapse or expand all groups at once
- Access advanced settings:
- Group by subdomain
- Preserve manual color choices
- Create and manage custom rules for advanced grouping
Create named tab groups that combine multiple domains under a single group:
- Open the extension popup
- Click "Custom Rules" to expand the section
- Click "Add New Rule" to create your first rule
- Enter a group name (or let the system suggest one)
- Quick add from current tabs: Select domains from your currently open tabs instead of typing them manually
- Choose a color and save
Example Use Cases:
- Communication: Group
discord.com,teams.microsoft.com,slack.comunder "Communication" - Development: Group
github.com,stackoverflow.com,docs.google.comunder "Dev Tools" - Social Media: Group
twitter.com,facebook.com,instagram.comunder "Social"
The extension provides several ways to manage tab group colors:
- Automatic Colors: Each domain gets a consistent color by default
- Manual Customization:
- Right-click any tab group to change its color
- The extension can remember your custom color choices
- Random Generation:
- Click "Generate New Colors" to randomly assign new colors
- Use the "Preserve manual colors" setting to keep your custom choices when generating new colors
The extension provides convenient ways to manage your tab groups:
- Automatic Grouping:
- Tabs are automatically grouped by domain
- New tabs are added to existing groups
- Manual Controls:
- Group/Ungroup all tabs with one click
- Collapse or expand all groups simultaneously
- Right-click groups for individual controls
- Uses the
browser.tabs.group()API - Groups tabs based on their root domain
- Maintains group consistency during tab operations (refresh, new tab, etc.)
- Smart domain extraction with support for country code second-level domains (ccSLDs):
abc.net.auβ Groups as "abc" (recognizesco.auas single TLD)shop.example.co.ukβ Groups as "example" (recognizesco.ukas single TLD)www.github.comβ Groups as "github" (standard domain handling)
- Intelligently formats domain names for group titles:
- Removes TLD properly (e.g., ".com", ".org", ".co.uk")
- Removes "www" subdomain when present
- Special handling for IP addresses and local domains
- Tracks collapse state of all groups
- Provides unified controls for group visibility
- Maintains group state during tab operations
- Ensures smooth transitions when collapsing/expanding
The extension includes intelligent handling for country-specific domains that use two-part top-level domains:
Supported ccSLDs include:
- United Kingdom:
.co.uk,.org.uk,.net.uk,.ac.uk,.gov.uk - Australia:
.com.au,.net.au,.org.au,.edu.au,.gov.au - New Zealand:
.co.nz,.net.nz,.org.nz,.ac.nz,.govt.nz - South Africa:
.co.za,.org.za,.net.za,.ac.za,.gov.za - Japan:
.co.jp,.or.jp,.ne.jp,.ac.jp,.go.jp - South Korea:
.co.kr,.or.kr,.ne.kr,.ac.kr,.go.kr - And many more...
Examples:
abc.net.auβ Groups as "abc" (not "co")shop.example.co.ukβ Groups as "example" (not "co")api.service.com.auβ Groups as "service" (not "com")
This ensures that international users get proper domain grouping regardless of their country's domain structure.
-
Update version in
package.json -
Build the extension:
bun run zip # Chrome bun run zip:firefox # Firefox
-
Output files:
.output/auto-tab-groups-{version}-chrome.zip- Chrome extension.output/auto-tab-groups-{version}-firefox.zip- Firefox extension.output/auto-tab-groups-{version}-sources.zip- Source code (for Firefox review)
Chrome Web Store:
- Go to Chrome Web Store Developer Dashboard
- Upload the Chrome zip file
Firefox Add-ons:
Firefox requires source code submission because the extension uses build tools (WXT, Vite, TypeScript).
-
Upload the Firefox zip file (
auto-tab-groups-{version}-firefox.zip) -
When prompted "Do you need to submit source code?" select Yes
-
Upload the sources zip file (
auto-tab-groups-{version}-sources.zip) -
In the reviewer notes, add:
Build Instructions: 1. Install Bun: https://bun.sh 2. Run: bun install 3. Run: bun run build:firefox 4. Output in: .output/firefox-mv3/
Built by Nitzan Papini
See LICENSE.md for details.