Back to Projects

Development

Auto Refresh Tab - Firefox Extension

Auto Refresh Tab is a privacy-first Firefox extension I built because I couldn't find one that worked reliably. Each tab maintains its own independent interval, count, and settings — persisted across extension reloads and browser restarts using `storage.session`. Features include a visual SVG countdown ring, randomized refresh intervals, keyboard shortcut (Alt+R), and session persistence. Built with Manifest V3 and TypeScript for maintainability.

Auto Refresh Tab - Firefox Extension

Project Goals

  • Make tab auto-reloading dead simple — set interval, forget it.
  • Keep each tab's settings independent — refreshing Tab A shouldn't affect Tab B.
  • Zero data collection — no telemetry, no external requests, nothing leaves the browser.
  • Build with Manifest V3 for future-proofing as Firefox deprecates V2.

My Process

Built from the ground up for Manifest V3. Architecture splits cleanly into background service worker (timer logic, tab state), popup UI (settings interface), and content scripts (overlay countdown). Used Vitest for unit testing the timer logic and state persistence. Published to Firefox Add-ons after thorough testing on multiple Firefox versions.

Challenges & Solutions

  • Challenge:

    Per-tab state needs to survive extension reloads and browser restarts — `storage.session` was the only API that worked, but it has a 10MB limit.

    Solution:

    Used `storage.session` with proper serialization — each tab's state is a small JSON object (~200 bytes), so the 10MB limit is more than enough.

  • Challenge:

    The visual countdown ring in the popup needs to sync with the background timer — if the popup closes and reopens, the ring position was wrong.

    Solution:

    The popup reads the current timer position from the background worker on open, then runs its own `requestAnimationFrame` loop for the ring animation.

  • Challenge:

    Manifest V3 service workers can be terminated at any time — had to rebuild the timer logic to be resumable from persisted state.

    Solution:

    On service worker startup, iterate all `storage.session` entries and re-register timers for any tabs that are still open — handles both restart and reload.

Key Learnings

  • Manifest V3's service worker lifecycle is the biggest mental shift from V2 — design everything to be resumable.
  • Browser extension testing is manual-heavy — Vitest covers the logic, but you still need to test on real Firefox to catch UI edge cases.
  • Publishing to Firefox Add-ons requires careful review of permissions — they scrutinize `storage` and `tabs` permissions closely.

Gallery

Auto Refresh Tab - Firefox Extension screenshotAuto Refresh Tab - Firefox Extension screenshotAuto Refresh Tab - Firefox Extension screenshotAuto Refresh Tab - Firefox Extension screenshot