Adam Bandel


Tab Collection Manager

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

Overview

Tab Collection Manager (TCM) is a Chrome/Edge browser extension that transforms the new tab page into a comprehensive session management system. It enables users to save groups of browser tabs as “collections” organized within hierarchical “libraries,” making it easy to preserve research sessions, project contexts, or frequently-used tab groups for later restoration.

Built with vanilla JavaScript and modern Manifest V3 architecture, TCM prioritizes performance and simplicity. The extension uses IndexedDB for scalable local storage and implements a message-passing architecture between the service worker and UI components for data consistency across all open new tab instances.

Screenshots

Main Interface

Drag and Drop

Popup Quick Actions

Problem

Modern browsing often involves dozens of open tabs representing different research sessions, projects, or contexts. Browsers offer basic bookmarking but lack intuitive ways to save and restore entire tab sessions. Users either lose important tab groups when closing windows or resort to keeping windows perpetually open, consuming memory and creating clutter.

Existing session managers often feel clunky, require too many clicks, or don’t integrate naturally with the browsing workflow. There was a need for a solution that makes saving tabs as effortless as drag-and-drop while providing quick visual access to all saved sessions.

Approach

Stack

Challenges

Outcomes

The extension successfully provides a frictionless way to manage browser sessions. Key achievements include:

The project demonstrated that modern browser extensions can be built effectively without build tools or frameworks, leveraging native ES6 modules and Chrome’s extension APIs directly.

Implementation Notes

Data Model

The hierarchical structure uses order arrays for user-defined sequencing:

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

All data mutations flow through the service worker to ensure consistency:

// 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

For performance, the UI uses targeted updates when possible:

This balances responsiveness for frequent UI interactions with correctness for data mutations.


Related Posts