A powerful Chrome extension designed to help you stay focused and productive by blocking distracting websites with advanced features including focus timers, audio mode for YouTube, and flexible site management.
- Block any website instantly with simple URL input
- Individual site management with easy add/remove functionality
- Temporary whitelist system for specific pages
- Create custom site lists for different focus scenarios
- Set timed blocking sessions (hours and minutes)
- Visual timer display with countdown and progress indicator
- Extension badge shows active timer status
- Special audio-only mode for YouTube (music/podcasts)
- Hides visual content while preserving audio controls
- Keyboard shortcuts for media control (Space, β, β)
- Temporary disable option (1 minute)
- Create multiple themed lists (e.g., "Social Media", "News Sites")
- Bulk site management within lists
- Audio mode toggle per list
- Allowed pages system for exceptions
- Whitelist specific pages/URLs within blocked sites
- Pattern-based matching for flexible rules
- Per-site and per-list configurations
-
Clone this repository:
git clone https://github.com/yourusername/distraction-block.git cd distraction-block -
Open Chrome and navigate to
chrome://extensions/ -
Enable "Developer mode" (toggle in top right)
-
Click "Load unpacked" and select the
website-blockerfolder -
The extension icon will appear in your toolbar
Coming soon - extension will be published to Chrome Web Store
- Click the extension icon in your toolbar
- Enter a website URL (e.g.,
facebook.com) - Optionally enable "Audio Mode" for YouTube sites
- Click "Block" to add the site
- Create a site list by clicking "Create New List"
- Add sites to your list using the input field
- Set your desired focus duration (hours and minutes)
- Select your site list and click "Start Focus Session"
- The timer badge will appear on the extension icon
- Add
youtube.comwith "Audio Mode" enabled, or - Add YouTube to a site list with audio mode enabled
- When visiting YouTube, you'll see an audio-only overlay
- Use keyboard shortcuts or the temporary disable button
- Click "Allow Pages" next to any blocked site
- Add URL patterns for pages you want to access
- Examples:
/watch?v=abc123,/channel/UCexample
- Regular Lists: Block sites completely during timer sessions
- Audio Mode Lists: YouTube shows audio overlay, others blocked normally
- Allowed Pages: Specific URLs that remain accessible
- Duration: 1 minute to 23 hours 59 minutes
- Visual countdown with progress ring
- End session early option available
- Only works on YouTube domains (
youtube.com,www.youtube.com) - Preserves audio/video playback functionality
- Temporary disable: 1-minute access to full site
- Manifest V3 Chrome extension
- Service Worker background script for rule management
- Content Scripts for audio mode overlay
- Declarative Net Request API for efficient blocking
website-blocker/
βββ manifest.json # Extension configuration
βββ src/
β βββ background/
β β βββ background.js # Service worker & rule management
β βββ content/
β β βββ audio-mode.js # Audio mode overlay logic
β βββ popup/
β β βββ popup.html # Extension popup interface
β β βββ popup.js # Popup functionality
β β βββ popup.css # Styling
β βββ pages/
β β βββ blocked.html # Block page shown for blocked sites
β βββ assets/
β βββ icons/ # Extension icons
storage: Save blocked sites and preferencesdeclarativeNetRequest: Block websites efficientlyhost_permissions: Apply blocking rules to all websites
- Google Chrome browser
- Basic knowledge of JavaScript, HTML, CSS
- Chrome Extensions development familiarity
- Clone the repository
- Make changes to files in the
website-blocker/src/directory - Go to
chrome://extensions/and click the refresh icon on the extension - Test your changes
- Manages blocking rules using Declarative Net Request API
- Handles timer functionality and storage
- Processes messages from popup and content scripts
- Main user interface for managing sites and timers
- Real-time timer display with visual progress
- Site list management and configuration
- Injects audio mode overlay on YouTube sites
- Handles temporary disable functionality
- Provides keyboard shortcuts for media control
- Check if extension is enabled in
chrome://extensions/ - Try disabling and re-enabling the extension
- Reload the extension after any updates
- Verify the site is in your blocked list
- Check if there's an active timer that might affect blocking
- Ensure you're using the correct URL format (without
http://orhttps://)
- Ensure you have created at least one site list
- Check that the selected site list contains websites
- Verify the timer duration is set correctly
- Audio mode only works on YouTube (
youtube.com) - Check if the site has audio mode enabled in settings
- Try refreshing the YouTube page
Contributions are welcome! Please feel free to submit issues and pull requests.
- Follow existing code style and structure
- Test thoroughly across different scenarios
- Update documentation for new features
- Ensure compatibility with Chrome's latest APIs
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with modern Chrome Extensions Manifest V3 API
- Uses Declarative Net Request for efficient website blocking
- Designed with user experience and productivity in mind
Stay focused, stay productive! π―
For support or feature requests, please open an issue on GitHub.