A bare-bones Chrome extension that keeps track of the site you're focused on, syncs each visit with a mocked Neurable focus score, and visualizes how attentive you were on every domain you visited.
- ✅ Live tab tracking – automatically starts and stops a session whenever you switch tabs, navigate, or lose window focus.
- 💡 Real-time overlay – a tiny in-page widget streams your current focus score + sparkline while you stay on the site.
- 🔔 Action badge feedback – the extension icon shows the latest score at a glance.
- 🧠 Mocked Neurable data – each session gets a placeholder focus score (0–100). Swap the mock for the actual Neurable SDK/API when it's available.
- 📊 Per-site focus chart – popup shows a ranked card view with mini-bars plus aggregate metrics per hostname.
- 🕒 Recent history – quick list of the latest sessions with timestamps and focus points.
- 💾 Local persistence – sessions are stored in
chrome.storage.local(capped at the most recent 500 entries).
- The background service worker (
background.js) listens for tab/window events and records sessions longer than one second. - While a tab is active, the worker samples a mock Neurable score every 5 seconds, streams it to the page overlay + popup, and stores the samples for the session.
- Each session is stamped with its URL, hostname, duration, focus samples, and an averaged focus score.
- The popup (
popup.html+popup.js) aggregates stored sessions into per-domain averages, shows the live session card, and lists your recent history.
- Clone or download this folder.
- In Chrome, open chrome://extensions and enable Developer mode.
- Click Load unpacked and select the
focus-browserdirectory. - Pin the extension and start browsing—open the popup to see focus charts, the current session card, and the recent session log.
- Keep browsing in any tab to see the floating “Focus stream” overlay update in place (you can close it by disabling the extension or navigating away).
Replace the getNeurableFocusScore() function in background.js with the actual Neurable SDK call (e.g., fetch or WebSocket data). Ensure that:
- Focus values are normalized to
0–100so the UI stays consistent. - The data fetch is non-blocking; cache the latest value and read it synchronously when a session ends.
- Sync data to a backend or Google Sheets for long-term analytics.
- Add time filters (today, week, custom ranges) to the popup.
- Display richer charts (e.g., sparkline per site, timeline scatter plot).
- Surface productivity alerts when focus consistently drops on specific domains.
- Manifest V3 Chrome Extension
- Plain JavaScript + HTML/CSS (no frameworks)
chrome.tabs,chrome.windows, andchrome.storage
⚠️ Privacy note: All data stays in the browser viachrome.storage.local. No remote sync is performed in this MVP.