Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 3.39 KB

File metadata and controls

84 lines (57 loc) · 3.39 KB

Tab Session Manager CLI (tsm)

License:  0BSD Rust Build Status

A Rust-based command-line interface for the Tab-Session-Manager extension. This tool allows you to extract, query, and export session data directly from Zen Browser IndexedDB storage on macOS.

Features

  • Direct Storage Access: Reads and parses the binary IndexedDB data (including Snappy compression and SpiderMonkey Structured Clone format) directly from the browser profile.
  • Smart Formatting: Outputs sessions in a human-readable Markdown format with dates, titles, and session tags.
  • JSON Export: Supports --json flag for newline-delimited JSON output, perfect for scripting and integration with other tools.
  • Advanced Filtering:
    • By Date: Use natural language queries like --from "2 days", "yesterday", or specific dates.
    • By Type: Default to "user" sessions or include auto-saved types with --all.
  • Profile Detection: Automatically detects Zen Browser profiles and the specific extension UUID.

Prerequisites

  • macOS (currently only macOS is supported)
  • Zen Browser with Tab Session Manager extension installed
  • Rust toolchain (for building from source)

Installation

cargo install --path .

Usage

tsm --help
Tab Session Manager CLI

Usage: tsm [OPTIONS]

Options:
  -j, --json               Output as JSON lines
  -p, --profile <PROFILE>  Profile name to use
  -f, --from <FROM>        Filter sessions from a specific date (e.g. "2" or "2 days", "yesterday", "2024-01-01")
  -a, --all                Include all session types (default: only "user" sessions)
  -h, --help               Print help
  -V, --version            Print version

Examples

output

Technical Details

This tool implements a custom parser for the internal storage format used by Firefox/Zen for IndexedDB, which involves:

  1. SQLite: Reading the backing store.
  2. Snappy: Decompressing value blobs.
  3. Structured Clone: Parsing the SpiderMonkey binary serialization format.

Modular Architecture: moz-idb-sc

The core parsing logic is isolated in a separate crate moz-idb-sc (Mozilla IndexedDB Structured Clone), designed to be a re-usable library for:

  • Raw Data Export: Includes a binary sc-export for exporting raw data from any Firefox/SpiderMonkey IndexedDB.
  • Standalone Parsing: Can be used by other Rust projects to interpret proprietary Mozilla formats.

Using sc-export

The moz-idb-sc crate includes a standalone binary sc-export that can parse any Firefox/Zen IndexedDB SQLite file containing structured clone data.

# Install
cargo install --path moz-idb-sc --bin sc-export

# Usage
sc-export <path/to/sqlite/file>

It outputs newline-delimited JSON for every row found in the object_data table, making it an invaluable tool for debugging or data recovery.

Roadmap / Limitations

  • Currently macOS-only (Linux/Windows support not yet planned)
  • Zen Browser specific (could be extended to Firefox)