A Chrome extension that helps you stay focused by blocking distracting websites during study sessions.
- Focus Mode Toggle: Quickly enable/disable blocking from the popup
- Whitelist-Based Blocking: Only allow access to specific domains (e.g., learning sites)
- Pomodoro Timer: Set focus sessions (default 25 minutes)
- Custom Block Page: Friendly page showing why site was blocked + remaining time
- Persistent State: Settings survive browser restarts
- Daily Stats: Track how many distractions were blocked today
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top-right corner)
- Click Load unpacked
- Select the
Discipline Google Extensionfolder - The extension will appear in your toolbar
The extension works without custom icons, but you can add them:
- Create PNG images (16x16, 48x48, 128x128 pixels)
- Place them in the
icons/folder - Update
manifest.jsonto reference them
- Click the extension icon in your toolbar
- Toggle Focus Mode ON to start blocking
- Add allowed sites to your whitelist (e.g.,
scrimba.com) - Start a timer for timed focus sessions (auto-disables when done)
- Blocked sites will show a friendly "Focus Mode Active" page
The extension comes with these sites pre-whitelisted:
- github.com
- stackoverflow.com
You can add or remove sites from the popup.
Discipline Google Extension/
├── manifest.json # Extension configuration
├── background.js # Service worker (blocking logic, timer)
├── popup/
│ ├── popup.html # Popup UI
│ ├── popup.js # Popup logic
│ └── popup.css # Popup styles
├── blocked/
│ ├── blocked.html # Block page
│ ├── blocked.js # Block page logic
│ └── blocked.css # Block page styles
└── icons/ # Extension icons (optional)
- Manifest V3: Uses modern Chrome extension APIs
- Service Worker: Handles background logic, survives browser restarts
- chrome.alarms: Reliable timer that works even when popup is closed
- chrome.storage.local: Persists all settings locally
- Cannot block
chrome://pages (browser security) - Cannot block other extensions' pages
- User can always disable the extension (this is a self-discipline tool)
- Timer has 1-minute minimum granularity (Chrome alarms limitation)
To modify the extension:
- Edit the source files
- Go to
chrome://extensions/ - Click the refresh icon on the extension card
- Changes will take effect immediately
MIT License - Feel free to modify and use for your own purposes.