Adam Bandel


Tab Collection Manager

Apr 2025
Type: browser-extension
Code: 6k lines
Files: 30
Active: Apr 2025 to Apr 2025
Stack:
JavaScriptChrome Extension APIsIndexedDBSortableJS
Tags:
developer-toolsproductivityautomation

Overview

Tab Collection Manager (TCM) is a Chrome and Edge extension that replaces the new tab page with a place to save groups of tabs and open them again later. Saved tabs go into collections, and collections into libraries. It’s on the Chrome Web Store.

It’s plain JavaScript on Manifest V3, with no framework and no build step. The data lives in IndexedDB, and every change goes through the service worker, which then tells every open new tab page to reload its data, so they all show the same thing.

Screenshots

Main Interface

Drag and Drop

Popup Quick Actions

Problem

I always end up with lots of tabs open when I’m deep in a topic or working with some set of tools, and moving from one topic to the next leaves a pile of them. Sometimes I want to close them and get back to them later, or save a group of related links for a project. Browsers have bookmarks, but no good way to save a whole set of tabs and bring it back, so the fallback is leaving windows open.

I used the Toby Tabs extension for this for years, and it was free. Sometime in 2024 Toby started deprecating features to push people onto its paid Pro plan. I’m not having it, and Chrome extensions are a joke to create, so I made my own. It took me one day. It has every feature Toby does except sync, and it’s snappier than Toby. The other tab collection extensions I’ve seen all get bloated with features.

Approach

Stack

Challenges

Outcomes

There’s nothing to set up: installing it replaces the new tab page. The page has three panes, with libraries on the left, the current library’s collections and tabs in the middle, and the open browser windows and their tabs on the right. Libraries hold collections, and collections hold tabs. Tabs are animated as they’re added and removed.

Everything can be imported and exported as JSON. One of the export buttons doesn’t work, but you can still export everything.

There’s no sync. Saved collections stay in the browser that saved them. I could build it, but there were trade-offs I didn’t care about enough.

Implementation Notes

Data Model

Each level keeps an array of its children’s IDs, which holds the order the user arranged them in:

Library {
  id, name, color, createdAt,
  collectionOrder: [collectionId, ...]  // User-defined order
}

Collection {
  id, libraryId, name, color, createdAt, lastModifiedAt,
  tabOrder: [tabId, ...]  // User-defined order
}

Tab {
  id, collectionId, title, url, faviconUrl, createdAt
}

Message-Passing Architecture

Every data change goes through the service worker, which then notifies each open new tab page:

// UI sends action request
chrome.runtime.sendMessage({ 
  action: 'addTabToCollection', 
  collectionId, tab 
});

// Service Worker processes and broadcasts
export const activeNewTabIds = new Set();

chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
  // Process action...
  // Then notify all active new tab pages
  for (const tabId of activeNewTabIds) {
    chrome.tabs.sendMessage(tabId, { action: 'dataUpdated' });
  }
});

Dual Update Strategy

The new tab page updates in two ways:

Collapsing happens often and changes no saved data, so it skips the reload. Data changes always reload, so every page matches what’s stored.


Related Posts