Skip to content

aleksa-codes/easy-website-blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚫 Easy Website Blocker (WXT)

April 2026 Update: Migrated from CRXJS and improved with a cleaner architecture and modern UI stack.

A Chrome extension that blocks distracting websites using MV3 Declarative Net Request rules, with per-domain path exceptions and a polished popup/options/blocked-page experience.

Easy Website Blocker Screenshot

WXT React Tailwind CSS TypeScript Bun

Features

  • Fast MV3 blocking: Uses Chrome Declarative Net Request dynamic rules for reliable domain-level blocking.
  • Per-site exceptions: Allow specific paths (for example docs pages) while keeping the main domain blocked.
  • Live settings sync: Rule and toggle changes are persisted in Chrome storage and reflected immediately.
  • SPA fallback protection: Handles history-state navigation in single-page apps so blocked pages still redirect.
  • Three dedicated surfaces: Popup for quick control, Options for full management, and a custom Blocked page.
  • Modern UI stack: React 19 + Tailwind v4 + shadcn/ui primitives.

Quick Start

# Install dependencies
bun install

# Start extension dev mode
bun run dev

Then load the extension from .output/chrome-mv3 in chrome://extensions (Developer Mode -> Load unpacked).

Scripts

Command Description
bun run dev Run extension in dev mode
bun run dev:firefox Run dev mode for Firefox
bun run build Build production bundle
bun run build:firefox Build production bundle (Firefox)
bun run zip Create production zip
bun run zip:firefox Create production zip (Firefox)
bun run typecheck Run TypeScript checks
bun run format Format code with Prettier

Project Structure

src/
β”œβ”€ entrypoints/         # background + popup/options/blocked entry files
β”œβ”€ features/            # screen-level React features
β”œβ”€ components/          # reusable forms, lists, and UI wrappers
β”œβ”€ components/ui/       # shadcn-style UI primitives
β”œβ”€ lib/                 # storage, types, URL normalization/validation
└─ assets/              # global Tailwind stylesheet

How Blocking Works

  1. Rules are stored in chrome.storage.local.
  2. Settings are stored in chrome.storage.sync.
  3. Background worker maps saved rules to DNR dynamic allow/redirect rules.
  4. Navigation to blocked URLs is redirected to the bundled blocked page.
  5. SPA history updates are checked as a fallback to keep blocking consistent.

Load In Chrome

  1. Run bun run build.
  2. Open chrome://extensions.
  3. Enable Developer Mode.
  4. Click Load unpacked.
  5. Select .output/chrome-mv3.

Tech Stack

License

MIT License. See LICENSE for details.

About

🚫 Chrome extension to block distracting websites with customizable exceptions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors