Enforce daily time limits on websites. Take control of your browsing habits.
This project was entirely generated and developed by AI (Claude Code, using claude-opus-4-5). Every commit authored by AI is prefixed with (Claude Code) in the subject line and includes the footer Generated by AI (Claude Code, claude-opus-4-5). The full development history -- from initial scaffold through all feature iterations -- was driven by AI with human direction. You can view the complete implementation plans and development journals in the .ai/ directory (git-ignored, available only in local clones).
TimeWarden is a Manifest V3 browser extension (Firefox-first, Chrome-compatible) that works like iOS Screen Time for your browser. You configure per-domain daily time limits and the extension tracks your active browsing time, warns you as limits approach, and blocks access when time runs out.
Core principles:
youtube.com does not match music.youtube.com| Layer | Technology |
|---|---|
| Language | TypeScript (strict mode) |
| UI Framework | Svelte 5 (runes) |
| Styling | Tailwind CSS v4 |
| Build Tool | Vite 6 |
| Extension API | MV3 (browser.* namespace) |
| Runtime Dependencies | None |
# Clone the repository
git clone [email protected]:bwnn/timewarden.git
cd timewarden
# Install dependencies
pnpm install
# Build for production
pnpm run build
# Or watch for changes during development
pnpm run dev
The built extension is output to the dist/ directory.
about:debugging#/runtime/this-firefoxdist/ directory (e.g. dist/manifest.json)chrome://extensionsdist/ directoryNote: Chrome uses the
chrome.*namespace. TimeWarden is written against thebrowser.*API. A polyfill likewebextension-polyfillmay be needed for full Chrome compatibility -- this has not been thoroughly tested.
| Command | Description |
|---|---|
pnpm run dev |
Build in watch mode for development |
pnpm run build |
Production build to dist/ |
pnpm run bundle:firefox |
Build and package into an unsigned .zip for Firefox |
pnpm run typecheck |
Run TypeScript type checking |
pnpm run svelte-check |
Run Svelte-specific validation |
timewarden/
├── manifest.json # MV3 browser extension manifest
├── package.json
├── vite.config.ts # Multi-entry build config with post-build plugin
├── tsconfig.json
├── svelte.config.js
├── static/icons/ # Extension icons (SVG source + PNGs)
└── src/
├── app.css # Tailwind v4 entry + dark mode + a11y
├── browser.d.ts # WebExtension API type declarations
├── lib/
│ ├── types.ts # All shared TypeScript interfaces
│ ├── constants.ts # Defaults, limits, alarm prefixes
│ ├── utils.ts # Time formatting, date helpers
│ ├── domain-matcher.ts # Exact hostname matching
│ ├── messaging.ts # Typed message helpers
│ └── theme.ts # Dark mode management
├── background/
│ ├── index.ts # Service worker entry + message routing
│ ├── storage-manager.ts # All storage CRUD operations
│ ├── tab-tracker.ts # Tab lifecycle + shared state
│ ├── timer-engine.ts # Core tracking state machine
│ ├── reset-manager.ts # Per-domain reset scheduling
│ ├── notification-manager.ts
│ └── block-manager.ts # Grace period + blocking
├── entrypoints/ # HTML entry points for each UI page
├── popup/ # Toolbar popup UI
├── settings/ # Full-tab settings page
├── dashboard/ # Full-tab analytics dashboard
└── blocked/ # "Time's Up" blocked page
The background service worker is split into six focused modules:
browser.storage.local CRUD with a serialized operation queue to prevent race conditionsbrowser.alarmsUI pages communicate with the background via typed messages (browser.runtime.sendMessage). The popup polls for live status updates every second.
Signed Firefox .xpi files are available on the GitHub Releases page. These can be installed directly in Firefox without any developer settings.
The release workflow signs the extension via the AMO API, which requires API credentials:
AMO_JWT_ISSUER -- the JWT issuer (API key)AMO_JWT_SECRET -- the JWT secretPush a version tag:
git tag v1.0.0
git push origin v1.0.0
The GitHub Actions workflow will build the extension, sign it via AMO as an unlisted extension, and attach the signed .xpi to a new release.
For development and testing via about:debugging:
pnpm run bundle:firefox
# Output: web-ext-artifacts/timewarden-<version>.zip
browser.* namespace throughout; Chrome support is untested and may require a polyfillThis project does not currently include a license.