Skip to content

A lightweight WXT-powered browser extension that keeps tabs alive by auto-refreshing them on a schedule 🔄

License

Notifications You must be signed in to change notification settings

grikomsn/keepmealive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keep Me Alive

Keep Me Alive icon

A lightweight WXT-powered browser extension that keeps tabs alive by auto-refreshing them on a schedule. Supports continuous refresh, wait-until-load, and limited-run modes with a simple popup UI.

Hosted site: https://grikomsn.github.io/keepmealive/

Features

  • Per-tab refresh scheduling with configurable intervals (5s, 10s, 30s, 1m, 5m) or custom values.
  • Modes: Continuous, Wait for Load, Limited runs (auto-stop after N refreshes).
  • Browser action badge shows live countdown; clears when inactive.
  • Context menus: Start, Stop, and Quick Interval shortcuts from the popup.
  • Robust per-tab storage cleanup on tab close and error handling around reloads.

Popup

  • Shows current tab hostname, status, next refresh countdown, and active timers list.
  • Controls: interval dropdown (with custom), mode selector, limited-run count, Start/Stop/Reset.
  • Live updates via storage watch and background messaging.

Background behavior

  • One alarm per tab (refresh-<tabId>) scheduled from local:refreshConfigs.
  • On alarm: reloads the tab, handles limited-run decrement, and reschedules per mode.
  • Wait-for-load reschedules after tabs.onUpdated reports complete.
  • Badge updates every second with countdown seconds or ellipsis when overdue.
  • Message types (popup → background): START_REFRESH, STOP_REFRESH, GET_CONFIG, GET_ALL_CONFIGS (always includes tabId).

Context menus

  • Root: "Keep Me Alive" with Start (defaults to 1m), Stop, and Quick Interval entries for the predefined intervals.
  • Menu enabled/disabled state follows the active tab’s config; recreated on install/startup.

Types

  • RefreshMode: CONTINUOUS | WAIT_FOR_LOAD | LIMITED
  • RefreshConfig: { tabId, intervalMs, enabled, nextRefreshAt, mode, remainingRuns? }
  • INTERVALS: [5000, 10000, 30000, 60000, 300000]

Permissions

  • alarms, tabs, storage, activeTab, contextMenus (see wxt.config.ts).

Development

Built with WXT (Vite-based tooling for web extensions).

  • Install: bun install (postinstall regenerates WXT types).
  • Dev builds: bun run dev (Chrome), bun run dev:firefox.
  • Production builds: bun run build (Chrome MV3), bun run build:firefox (Firefox MV2).
  • Packaging: bun run zip, bun run zip:firefox.
  • Build outputs: dist/chrome-mv3/, dist/firefox-mv2/, dist/safari-mv2/ (zip commands place archives alongside).
  • Type-check only: bun run compile.
  • Release (GitHub): tag a release; workflow builds/zips Chrome & Firefox and uploads zips to assets.

Gotchas

  • Chrome MV3 alarms are most reliable at ≥1 minute; shorter mostly for dev.
  • Background listener returns true when replying asynchronously.
  • Storage is per-tab; entries cleared on tab close.
  • Always run bun run build after changes to catch manifest/TypeScript issues.

License

MIT License. See LICENSE for details.

About

A lightweight WXT-powered browser extension that keeps tabs alive by auto-refreshing them on a schedule 🔄

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published