This repository contains a Manifest V3 extension that lets you build focused browsing profiles. Each profile has its own blocklists (domains, URLs, and forbidden terms), allowlists, redirect/intercept behaviour, and can be activated manually or on a daily schedule. A popup, context menus, keyboard shortcuts, and JSON import/export make it fast to adapt the rules while you browse.
- Profiles – Maintain multiple profiles (e.g. Personal, Focus) and switch manually or automatically.
- Block lists – Domains (with subdomains), exact URLs, and substring terms.
- Allow lists – Domain/URL exceptions that override the block rules.
- Redirect modes – Choose between native blocking, redirecting to a custom URL, or showing the bundled blocker page.
- Focus schedule – Automatically switch to a target profile during selected days/times, then fall back to your default profile.
- Quick controls – Toolbar popup, context-menu shortcuts, and keyboard commands (
Ctrl+Shift+Uto toggle,Ctrl+Shift+Dto block current domain). - Import/export – Save or restore every profile, rule, and schedule as JSON.
- Clone or download the repository and open the
WebsiteBlockerfolder. - In Chrome, open
chrome://extensions/, enable Developer mode, and click Load unpacked. - Select the
WebsiteBlockerdirectory. - Configure the extension via the toolbar icon or Extension options.
- The service worker lives in
background.jsand is responsible for translating the selected profile into Declarative Net Request rules, context menu handling, keyboard commands, and alarm-driven scheduling. - UI files:
options.html/options.js– full management UI for profiles, lists, redirects, schedules, and import/export.popup.html/popup.js– quick-add domain/URL helpers tied to the active tab and profile.blocked.html– branded blocker page used when intercept mode is selected.
- The state is stored in
chrome.storage.syncunder theblockerStatekey and normalised in each script so updates remain backwards compatible. - When testing redirects, remember that Chrome cannot intercept
chrome://or internal browser pages.
Feel free to adapt the styling, default profiles, or scheduling logic to match your workflow.