Stay focused. Solve problems. Build consistency.
A Chrome extension that blocks distracting websites until you complete your daily LeetCode Practice. Build a consistent problem-solving habit with enforced discipline!
- Automatically redirects all websites to LeetCode until you meet your daily goal
- Loop-safe blocking mechanism prevents circumvention
- Keeps you focused on what matters
- Solve any LeetCode problem to unlock the web
- Set custom daily targets (1-100 problems)
- Perfect for consistent practice and skill building
- Must solve LeetCode's official daily challenge
- Fixed target of 1 problem per day
- Other problems won't count - only the daily challenge unlocks the web
- Build a streak on the most challenging problems
- Need to access the web urgently?
- Temporarily pause blocking (1-240 minutes)
- Countdown timer shows remaining break time
- Easy to resume blocking
- Real-time progress display
- Daily quota visualization
- Automatic reset at midnight
- Prevents duplicate counting
- Modern gradient design
- Smooth animations
- Clean, intuitive interface
- Responsive layout
-
Download the Extension
- Download
LeetCode-Focus.zip
from the releases - Extract the ZIP file to a folder on your computer
- Download
-
Open Chrome Extensions Page
- Open Google Chrome
- Navigate to
chrome://extensions/
- Or click Menu (⋮) → Extensions → Manage Extensions
-
Enable Developer Mode
- Toggle the "Developer mode" switch in the top-right corner
-
Load the Extension
- Click "Load unpacked" button
- Select the extracted
LeetCode-Focus
folder - The extension will now appear in your extensions list
-
Pin the Extension (Optional)
- Click the puzzle icon in the Chrome toolbar
- Find "LeetCode Focus" and click the pin icon
- The extension icon will now appear in your toolbar
Coming soon!
-
Click the Extension Icon
- Click the LeetCode Focus icon in your toolbar
- The popup will open showing your settings
-
Choose Your Mode
- Any Problem: Solve any problem to unlock (default)
- Daily Problem: Only the daily challenge counts
-
Set Your Target (Any Problem mode only)
- Choose how many problems you want to solve daily (1-100)
- Daily Problem mode is always fixed at 1
-
Save Settings
- Click "💾 Save Settings"
- The extension is now active!
- Navigate to a LeetCode problem
- Write your solution
- Click "Submit"
- Get "Accepted" status
- The extension automatically detects and counts it!
- Click the extension icon to see your progress
- Badge shows current count (e.g., "0/1", "1/3")
- Badge color:
- 🔴 Red: Quota not met
- 🟢 Green: Quota completed!
- ⏸️ Gray: On break
- Click the extension icon
- Scroll to "Emergency Break" section
- Set duration (1-240 minutes)
- Click "⏸️ Start" button
- Websites are now accessible
- Click "
▶️ End" to resume blocking early
Click "Options" or right-click the extension icon → Options for:
- Detailed mode explanations
- Larger, more comfortable interface
- Same functionality as popup
- Uses Chrome's
declarativeNetRequest
API - Two-rule system prevents redirect loops:
- Allow Rule (Priority 2): Allows LeetCode domains
- Redirect Rule (Priority 1): Redirects everything else to LeetCode
- Content script injected into LeetCode problem pages
- Detects "Submit" button clicks
- Arms a 10-minute detection window
- Watches for "Accepted" status in the DOM
- Prevents duplicate counting per problem
- Checks URL patterns for daily challenge indicators
- Scans DOM for calendar icons and daily badges
- Only counts daily challenge in "Daily Problem" mode
- Uses Chrome's
storage.local
API - Stores settings, progress, and break status
- Daily progress tracked by date (YYYY-MM-DD)
- Automatically resets at midnight
LeetCode-Focus/
├── manifest.json # Extension configuration
├── background.js # Service worker (blocking logic)
├── content.js # Problem detection script
├── popup.html # Extension popup UI
├── popup.js # Popup logic
├── options.html # Options page UI
├── options.js # Options logic
├── icons/
│ ├── icon16.png # Toolbar icon
│ └── icon48.png # Extension page icon
└── README.md # This file

Features shown:
- Today's progress with gradient card
- Mode selector with dynamic hints
- Daily target input (Any Problem mode)
- Emergency break controls with live countdown
- Clean, modern design with smooth animations

Features shown:
- Full-screen settings interface
- Detailed mode explanations with info boxes
- Large, comfortable controls
- Beautiful gradient background
- Progress tracking with motivational badges
The extension requires these permissions:
storage
: Save your settings and daily progressalarms
: Schedule break timersdeclarativeNetRequest
: Block/redirect websitesscripting
: Inject detection script on LeetCode pagestabs
: Monitor tab changes for blocking updates<all_urls>
: Access to redirect non-LeetCode siteshttps://leetcode.com/*
: Detect solved problems
- Check if you've met your daily quota
- Verify you're not on an emergency break
- Try refreshing the page
- Restart the extension
- Make sure you clicked "Submit" (not "Run Code")
- Wait for "Accepted" status to appear
- Check if you're in Daily mode but solving a non-daily problem
- Check the extension icon badge
- Open popup to verify count
- Settings may need to be re-saved
- Click "Start Break" again
- Try refreshing the extension
- Check remaining time in the popup
Contributions are welcome! Here's how you can help:
- Report Bugs: Open an issue with details
- Suggest Features: Share your ideas
- Submit PRs: Fork, code, and submit pull requests
- Improve Docs: Help make the README better
MIT License - feel free to use, modify, and distribute!
- Inspired by productivity tools like Cold Turkey and Freedom
- Built for the LeetCode community
- Special thanks to all problem solvers building consistency!
Having issues or questions?
- Open an issue on GitHub
- Check the Troubleshooting section
- Review the FAQ below
Q: Can I whitelist certain websites?
A: Currently, no. The extension blocks all non-LeetCode sites to maintain focus. This is intentional for maximum productivity.
Q: Does it work on LeetCode CN?
A: Yes! The extension supports both leetcode.com and leetcode.cn.
Q: What happens at midnight?
A: Your progress resets automatically. You'll need to solve problems again the next day.
Q: Can I use this on other browsers?
A: Currently only Chrome and Chromium-based browsers (Edge, Brave, etc.) are supported.
Q: Will my progress sync across devices?
A: Not yet. Progress is stored locally on each device.
Q: What if I solve a problem without clicking Submit?
A: The extension only counts problems when you click Submit and get Accepted. Run Code doesn't count.
Q: Can I set different targets for weekdays/weekends?
A: Not currently. The target is the same every day. This may be added in a future version.
- Weekly/monthly statistics
- Difficulty-based quotas (Easy=1, Medium=2, Hard=3)
- Export/import progress data
- Sync across devices
- Customizable redirect destinations
- Whitelist for educational sites
- Notifications when quota is met
- Streak tracking
- Dark mode
- Language localization
- Chrome Web Store release
- Firefox support
- Mobile companion app
Made with 💜 for productive developers
Happy Coding! Keep solving, keep improving! 🚀