Skip to content

banana-bread/focus-guard

Repository files navigation

Focus Guard

A Chromium MV3 extension that blocks distracting websites and requires a physical security key (YubiKey / FIDO2) to temporarily unlock them. Friction-based self-discipline — no server, no accounts, no runtime dependencies.

How It Works

  1. Register a hardware security key (WebAuthn, cross-platform attachment only)
  2. Add domains to your blocklist — they're instantly blocked via declarativeNetRequest
  3. To visit a blocked site, tap your security key to start a timed unlock session
  4. When the timer expires, the site is re-blocked automatically

Removing domains or replacing your credential also requires a key tap.

Dev Setup

pnpm install
pnpm build          # one-shot build
pnpm build:watch    # rebuild on change

Load in Browser

  1. Navigate to brave://extensions or chrome://extensions
  2. Enable Developer mode
  3. Click Load unpacked → select the dist/ directory
  4. After rebuilds, click the reload icon on the extension card

Validate

pnpm typecheck      # strict TypeScript check
pnpm lint           # ESLint
pnpm format:check   # Prettier
pnpm test           # Vitest unit tests

Tech Stack

  • TypeScript (strict mode) — zero runtime dependencies
  • Vite for bundling
  • Vitest for testing
  • Chromium Manifest V3 APIs
  • Vanilla TS for UI — no frameworks

About

Chrome extension that blocks distracting sites and requires a physical hardware security key (WebAuthn/FIDO2) to unlock them.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors