Skip to content

exmateriae/websiteblocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

URL & Domain Blocker – Chrome MV3 extension

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.

Features

  • 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+U to toggle, Ctrl+Shift+D to block current domain).
  • Import/export – Save or restore every profile, rule, and schedule as JSON.

Install (unpacked)

  1. Clone or download the repository and open the WebsiteBlocker folder.
  2. In Chrome, open chrome://extensions/, enable Developer mode, and click Load unpacked.
  3. Select the WebsiteBlocker directory.
  4. Configure the extension via the toolbar icon or Extension options.

Development notes

  • The service worker lives in background.js and 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.sync under the blockerState key 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.

About

I need to block specific domains and urls.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published