A lightweight Google Chrome extension that calculates and displays your Current Streak right next to your Max Streak on your LeetCode profile.
The Origin Story: I built this after tragically losing an 89-day LeetCode streak. I was tired of manually calculating the calendar math to figure out when I would finally overtake my past record, so I engineered this extension to do it for me!
- Live Calculation: Fetches real-time submission data via LeetCode's GraphQL API.
- Seamless UI Integration: Injects the active, ongoing streak directly into the UI, matching LeetCode's native CSS perfectly.
- React-Resilient: Uses a
TreeWalkerand aMutationObserverto ensure the UI updates reliably, even when navigating LeetCode's Single Page Application (SPA) routing.
- Clone this repository or download the ZIP file.
- Open Google Chrome and navigate to
chrome://extensions/. - Enable Developer mode in the top right corner.
- Click Load unpacked and select the folder containing this extension.
- Visit your LeetCode Profile to see it in action!
Injecting elements into a heavily optimized React application is tricky. LeetCode dynamically re-renders its DOM and uses randomized utility classes. Instead of relying on static CSS selectors, this extension uses a TreeWalker to scan raw text nodes for the "Max Streak" label, ensuring the injection target is found 100% of the time regardless of UI updates.