A Chrome extension designed to help you stay focused by blocking distracting websites with confirmation prompts.
- Regex Pattern Blocking: Use regular expressions to block websites that match specific patterns
- Confirmation Prompts: Require typing a specific sentence to access blocked sites
- Customizable Confirmation Text: Set your own confirmation message
- Pattern Management: Easy interface to add, edit, and toggle patterns
- Pattern Testing: Test your regex patterns before applying them
- Modern UI: Clean, responsive design that works well in all browsers
- Download the extension: Clone or download this repository to your computer
- Open Extension Management:
- In Brave: Go to
brave://extensions/ - In Chrome: Go to
chrome://extensions/
- In Brave: Go to
- Enable Developer Mode: Toggle the "Developer mode" switch in the top right
- Load the Extension: Click "Load unpacked" and select the extension folder
- Pin the Extension: Click the puzzle piece icon in the toolbar and pin the Focus extension
- Open Settings: Click the Focus extension icon and select "Settings"
- Add a Pattern:
- Enter a descriptive name (e.g., "Social Media")
- Enter a regex pattern (e.g.,
.*(facebook|twitter|instagram)\.com.*) - Click "Add Pattern"
- Test Patterns: Use the "Test Pattern" button to verify your regex works correctly
- Manage Patterns: Toggle patterns on/off or delete them as needed
Here are some useful regex patterns to get you started:
- Social Media:
.*(facebook|twitter|instagram|tiktok)\.com.* - News Sites:
.*(cnn|bbc|reddit|news)\.com.* - Video Platforms:
.*(youtube|twitch|netflix)\.com.* - General Distractions:
.*(youtube|facebook|twitter|reddit|instagram)\.com.*
- Go to Settings
- Change the "Confirmation Text" field
- The text will auto-save as you type
- This text must be typed exactly to access blocked sites
- Normal Browsing: Browse normally - the extension runs in the background
- Blocked Site Access: When you try to visit a blocked site:
- You'll see a Focus Mode page
- Read the confirmation text carefully
- Type it exactly as shown
- Click "Proceed to Site" or press Enter
- Quick Access: Use the "Go Back" button or press Escape to return
The extension uses Chrome's webNavigation API to intercept navigation attempts. When you try to visit a URL that matches one of your regex patterns, the extension:
- Blocks the navigation
- Redirects to a custom blocking page
- Shows the confirmation prompt
- Requires exact text input to proceed
- Allows access only after correct confirmation
- No Data Collection: The extension doesn't collect or transmit any personal data
- Local Storage: All patterns and settings are stored locally in your browser
- No External Connections: The extension doesn't make any network requests
The extension requires these permissions:
webNavigation: To intercept navigation attemptsstorage: To save your patterns and settingsactiveTab: To manage blocked tabs<all_urls>: To check URLs against patterns
Feel free to submit issues and enhancement requests!
This project is open source and available under the MIT License.
Stay focused, stay productive! 🎯