Your daily LeetCode companion! A Chrome extension that helps you stay focused and complete coding problem sets by restricting access to non-whitelisted websites until you solve your daily problem.
- β Automatic Problem Tracking: Detects when you solve problems on LeetCode and automatically advances to the next one
- π« Website Blocking: Redirects non-whitelisted websites to your current problem until you solve it
- π― Multiple Problem Sets: Choose from Blind 75, NeetCode 150, NeetCode 250, or NeetCode All
- π² Random Problem Selection: Option to randomly select from unsolved problems instead of going in sequence
- π Progress Tracking: Visual progress bars showing your progress overall and by category
- β±οΈ Timed Bypass: Take a 10-minute break when needed (30-minute cooldown)
- π Auto-Sync: Automatically syncs with your LeetCode account status
- π Celebrations: Optional confetti animations when you solve your daily problem
- βοΈ Customizable Exclusions: Add up to 10 websites to exclude from redirection
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in the top-right corner)
- Click Load unpacked
- Select the
leetcodeForcerfolder - The extension should now appear in your extensions list
- Navigate to leetcode.com
- Log in to your LeetCode account
- The extension will automatically sync your solved problems
- Right-click the extension icon and select Options (or click the βοΈ Settings button in the popup)
- Choose your preferred problem set (Blind 75, NeetCode 150, NeetCode 250, or NeetCode All)
- Customize your preferences (see Settings & Configuration below)
Once installed, the extension will:
- Redirect all non-whitelisted websites to your current problem
- Track your progress automatically
- Update to the next problem when you solve the current one
- Unblock all websites after you solve your daily problem (until midnight)
Click the extension icon in your Chrome toolbar to see:
- Overall Progress: Total problems solved with a visual progress bar
- Current Problem: The problem you need to solve next, with direct links to LeetCode and NeetCode video solutions
- Category Progress: Breakdown of solved problems by category
- Daily Status: Whether you've completed today's problem
- The extension automatically redirects you to your current problem when you try to visit non-whitelisted sites
- Work on the problem on LeetCode
- Submit your solution
- Once your submission is marked as "Accepted", the extension will:
- Show a celebration animation (if enabled)
- Mark the problem as solved
- Advance to the next problem
- Unblock all websites until midnight
When you need a breather:
- Click the extension icon
- Click "Start Break (10 min)"
- You'll have 10 minutes of unrestricted browsing
- After the break, the redirect automatically resumes
- You can take another break after a 30-minute cooldown
If you've solved problems outside the extension or want to force a sync:
- Click the extension icon
- Click "π Refresh Status"
- The extension will query LeetCode for your latest progress and update accordingly
- Click the extension icon
- Click "βοΈ Settings" to open the options page
- Configure your preferences (see Settings & Configuration below)
Access settings by right-clicking the extension icon and selecting Options, or click the βοΈ Settings button in the popup.
Choose which problem set you want to work through:
- Blind 75: The classic 75 essential problems
- NeetCode 150: 150 curated problems
- NeetCode 250: 250 problems organized by category
- NeetCode All: Comprehensive collection of all NeetCode problems
- Celebration Animations: Toggle confetti and celebration animations when you solve your daily problem
- Sort Problems by Difficulty: Sort problems within each category by difficulty (Easy β Medium β Hard) instead of the original problemset order
- Random Problem Selection: Select problems randomly from unsolved problems instead of going in sequence
- Clear Editor on First Open (Experimental): Clear the code editor content when you first open a problem each day. Subsequent refreshes will preserve your work.
Customize which websites are excluded from redirection:
-
System Domains (Always Excluded): These domains are required for the extension to function:
leetcode.com- Solve problemsneetcode.io- View problem lists and solutionsaccounts.google.com- Google OAuth authentication
-
Your Custom Domains: Add up to 10 additional websites to exclude from redirection:
- Enter a domain (e.g.,
github.com) in the input field - Click "Add Domain"
- Remove domains by clicking the Γ button next to them
- Click "Reset to Defaults" to restore default exclusions (GitHub, LinkedIn)
- Enter a domain (e.g.,
View all problems organized by category with visual progress indicators. Click categories to expand and see individual problems and their status.
If you want to start fresh:
- Scroll to the Reset Progress section
- Click "Reset All Progress"
- Confirm the action (this cannot be undone)
- Make sure you're logged in to LeetCode
- Check that the extension is enabled in
chrome://extensions/ - Verify that you haven't already solved today's problem (websites are unblocked after solving)
- Try clicking "π Refresh Status" in the extension popup
- Check the exclusion list in settings to ensure the site isn't excluded
- Ensure your submission is marked as "Accepted" on LeetCode
- Wait a few seconds for the extension to detect the change
- Try refreshing the LeetCode problem page
- Click "π Refresh Status" in the extension popup
- Check the browser console for any error messages
- Check your internet connection
- Make sure the sites are using
https:// - Verify the domain is in your exclusion list (Settings β Exclusion List)
- Try disabling and re-enabling the extension
- Make sure you're logged in to LeetCode
- Click "π Refresh Status" in the extension popup
- Check that Chrome sync is enabled (for cross-device sync)
- Verify your LeetCode account has the problems marked as solved
- Check Settings β Display Preferences β Celebration Animations is enabled
- Make sure you're solving the expected problem (not a different one)
- Verify the problem was solved today (not in the past)
Leetcode Buddy uses a modular architecture with ES6 modules for better maintainability and testability:
src/background/index.js- Main entry point & lifecycle managementsrc/background/storage.js- Chrome storage operationssrc/background/problemLogic.js- Problem set management & progress calculationsrc/background/redirects.js- Redirect rules & bypass functionalitysrc/background/messageHandler.js- Message routing & handlers
src/content/index.js- Main entry point & DOM observationsrc/content/api.js- LeetCode API layersrc/content/detector.js- Problem solve detection logic with optimization guardssrc/content/ui.js- Celebrations & notifications
src/shared/constants.js- Shared constants across modules
See docs/ARCHITECTURE.md for detailed technical documentation.
leetcodeForcer/
βββ manifest.json # Extension configuration
βββ src/
β βββ background/ # Background service worker modules
β β βββ index.js
β β βββ storage.js
β β βββ problemLogic.js
β β βββ redirects.js
β β βββ messageHandler.js
β βββ content/ # Content script modules
β β βββ index.js
β β βββ api.js
β β βββ detector.js
β β βββ editor.js
β β βββ ui.js
β βββ shared/ # Shared constants
β β βββ constants.js
β βββ assets/ # Icons, data, styles
β βββ icons/
β βββ data/
β β βββ blind75.json
β β βββ neetcode150.json
β β βββ neetcode250.json
β β βββ neetcodeAll.json
β β βββ problemAliases.json
β βββ styles/
βββ tests/ # Unit and integration tests
β βββ background/
β βββ content/
β βββ integration/
βββ docs/ # Documentation
βββ popup.html/js/css # Extension popup
βββ options.html/js/css # Extension options
βββ package.json # Node dependencies
The extension uses Chrome's declarativeNetRequest API to redirect all navigation to non-excluded websites. The exclusion list consists of:
- System-enforced domains (LeetCode, NeetCode, Google OAuth) - always excluded
- User-defined domains (up to 10 custom domains) - configurable in settings
When you're on a LeetCode problem page, the content script:
- Monitors the page for successful submission indicators (DOM mutations)
- Queries LeetCode's GraphQL API to confirm the problem status
- Verifies the submission was made today (not in the past)
- Checks that it's the expected problem (not a different one)
- Notifies the background service worker when status is "Accepted"
- Automatically advances to the next problem in the list
- Optimizes by skipping redundant checks once a problem is confirmed solved today
Your progress is stored in Chrome's sync storage and automatically backed up across devices. The extension:
- Tracks which problems you've solved (stored as problem slugs)
- Maintains your current position in the selected problem set
- Syncs with LeetCode's API on startup and when manually refreshed
- Tracks daily solve status (resets at midnight)
The extension requires:
storage- Store progress and settingsdeclarativeNetRequest- Implement website blocking/redirectinghost_permissions- Access LeetCode API and all URLs for redirection
- LeetCode GraphQL API: Check problem solve status and fetch submission history
- Endpoint:
https://leetcode.com/graphql - Queries:
questionStatus,recentSubmissionList,submissionList,globalData
- Endpoint:
- LeetCode Problems API: Bulk fetch all problem statuses
- Endpoint:
https://leetcode.com/api/problems/all/
- Endpoint:
-
chrome.storage.sync:currentProblemSlug- Current problem slugcategoryIndex- Current category indexproblemIndex- Current problem index within categorysolvedProblems- Array of solved problem slugsactiveProblemSet- Selected problem set IDuserExclusionList- User-defined exclusion domainsrandomProblemSelection- Random selection togglesortByDifficulty- Sort by difficulty toggleclearEditorOnFirstOpen- Clear editor togglecelebrationEnabled- Celebration animations toggle
-
chrome.storage.local:bypassUntil- Timestamp when bypass expiresnextBypassAllowed- Timestamp when next bypass can be activateddailySolveDate- Date when daily problem was solved (YYYY-MM-DD)dailySolveProblem- Slug of the problem solved todayproblemFirstOpened_*- Per-problem first-open tracking for editor clearing
- Clone the repository
- Install dependencies:
npm install
- Load extension in Chrome (Developer Mode)
- Make your changes
The project includes comprehensive unit and integration tests:
# Run all tests
npm test
# Watch mode for development
npm run test:watch
# Generate coverage report
npm run test:coverageTest Coverage Goals:
- 80%+ line coverage
- 80%+ branch coverage
- 80%+ function coverage
See docs/TESTING.md for detailed testing guide.
- Make changes to the source files
- Go to
chrome://extensions/ - Click the refresh icon on the extension card
- Test your changes
- Background Script:
chrome://extensions/β Click "service worker" under the extension - Content Script: Open DevTools on any LeetCode problem page
- Popup: Right-click the extension icon β "Inspect popup"
- Options Page: Right-click the extension icon β "Options" β Open DevTools
See docs/CONTRIBUTING.md for development guidelines and best practices.
Use the Settings page (Options β Exclusion List) to add up to 10 custom domains. For system-level changes, edit src/shared/constants.js:
export const DEFAULT_USER_EXCLUSION_LIST = [
"github.com",
"linkedin.com",
"your-site.com",
];Edit src/shared/constants.js:
export const BYPASS_DURATION_MS = 15 * 60 * 1000; // 15 minutes
export const COOLDOWN_DURATION_MS = 60 * 60 * 1000; // 60 minutesProblem sets are stored in JSON format in src/assets/data/:
blind75.jsonneetcode150.jsonneetcode250.jsonneetcodeAll.json
Each file contains an array of categories, with each category containing an array of problems with properties: slug, leetcodeId, title, difficulty, category.
Edit src/assets/data/problemAliases.json to add or modify problem slug aliases for better matching.
MIT License - Feel free to modify and distribute
- NeetCode problem lists curated by NeetCode
- Built with Chrome Extension Manifest V3
Good luck with your grinding! πͺ
Remember: The only way out is through. Stay focused and you'll complete all your problems!