Skip to content

RizaSatya/tabsmith

Repository files navigation

Auto Group Tabs

A Chrome/Brave extension that automatically organizes your tabs into groups by domain.

What It Does

  • Auto-groups tabs by root domain (e.g., github.com, stackoverflow.com) as you browse
  • Creates collapsible tab groups with colored headers for quick navigation
  • Searchable popup to quickly find and switch between tabs
  • Keyboard-first navigation: Ctrl+Shift+K to open, arrows to navigate, Enter to select

Problem It Solves

Managing 50+ tabs is a nightmare. You end up with scattered tabs from the same site, no way to quickly find what you need, and a chaotic tab bar. This extension solves that by:

  • Automatically grouping tabs from the same domain into collapsible sections
  • Making all your tabs searchable via a quick popup
  • Giving each domain a consistent color, so you can visually identify clusters at a glance

Installation

  1. Clone or download this repository
  2. Open chrome://extensions (or brave://extensions in Brave)
  3. Enable Developer mode (toggle in top-right)
  4. Click Load unpacked and select the project folder
  5. You can now open the search popup by clicking the extension icon or pressing Ctrl+Shift+K (Windows/Linux) / Cmd+Shift+K (macOS)

Usage

Opening the Search Popup

Method Shortcut
Toolbar Click the extension icon
Keyboard (Windows/Linux) Ctrl+Shift+K
Keyboard (macOS) Cmd+Shift+K

Navigating the Popup

Key Action
/ Navigate between results
Enter Switch to selected tab
Escape Close popup

Grouping Behavior

  • Group All Tabs — Manually group all open tabs by domain
  • Ungroup All — Remove all tab groups
  • Auto-grouping toggle — Enable/disable automatic grouping for new tabs. This preference is persisted to chrome.storage.local.
  • Groups are created per-window (tabs from the same domain in different windows get separate groups)
  • Root domains are extracted intelligently: docs.github.comgithub, api.stripe.comstripe
  • Special URLs (chrome://, about:, extension://) are ignored and not grouped
  • localhost, 127.0.0.1, and .local domains are grouped together under "localhost"

Architecture

├── manifest.json       # Extension manifest (Manifest V3)
├── background.js       # Service worker: handles tab grouping logic
├── background.test.js  # Tests for background logic
├── popup.html          # Popup UI
├── popup.js            # Popup interactivity & search
├── popup.css           # Popup styles
├── popup.test.js       # Tests for popup utilities
├── searchUtils.js      # Shared search utilities
└── icons/              # Extension icons

Key Behaviors

  • background.js listens to tabs.onCreated and tabs.onUpdated to auto-group tabs
  • The popup queries chrome.tabs.query() and chrome.tabGroups APIs directly
  • Domain-to-group mapping is cached in memory to avoid redundant Chrome API calls
  • Groups are collapsed by default (collapsed: true) to keep the tab bar tidy

Running Tests

node background.test.js
node popup.test.js

The test suite verifies:

  • Tabs from the same domain in one window are grouped together
  • Same domain in different windows creates separate groups
  • Stale group references are handled gracefully
  • about:blank and special URLs are not grouped
  • Tab URL updates trigger re-grouping
  • Tab filtering (case-insensitive title search)
  • Search result grouping by tab group
  • HTML escaping and text highlighting

Permissions

Permission Purpose
tabs Read tab URLs and titles for grouping
tabGroups Create and update tab groups
storage Persist the enabled/disabled toggle

Browser Compatibility

Tested on Brave (Manifest V3). Works on Chrome 89+ and other Chromium-based browsers with Manifest V3 support.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors