A Chrome extension that shows your browsing history with time-spent insights, search, and visualisations. All data stays local on your device.
# Install dependencies
npm install
# Build the extension
npm run build
Then load in Chrome:
chrome://extensionsdist/ foldernpm run dev
This starts Vite in watch mode with hot reload for the dashboard.
For changes to the background script or popup, run npm run build and reload the extension at chrome://extensions.
This project ships without icon PNGs in public/icons/ — Chrome will use a default icon if they’re missing, which is fine for development. To add your own:
public/icons/icon16.png (16×16)public/icons/icon48.png (48×48)public/icons/icon128.png (128×128)trail-extension/
├── public/
│ └── manifest.json # Chrome extension manifest
├── src/
│ ├── background/ # Service worker — time tracking
│ ├── popup/ # Toolbar popup (quick stats)
│ ├── dashboard/ # Full-page dashboard
│ │ └── components/ # StatsOverview, HistoryView, SitesView, SettingsView
│ ├── lib/ # storage, analytics, types
│ └── styles/ # Tailwind globals
├── vite.config.ts
├── tailwind.config.js
└── package.json
The service worker listens for tab activations, URL changes, window focus changes, and idle state changes. Each “session” starts when you focus a page and ends when you switch away, go idle, or close the tab. Sessions shorter than 1.5 seconds are discarded.
Visits are stored in chrome.storage.local (the active session lives in chrome.storage.session so it doesn’t get lost if the service worker sleeps). Old visits are auto-deleted based on your retention setting.
MIT