Chrome extension scaffold that watches LeetCode's submission network flow and commits accepted solutions into a selected GitHub repository.
- Hooks LeetCode's
submitGraphQL request to capture the exact code sent to LeetCode. - Hooks LeetCode's submission
checkrequest and only uploads after the result isAccepted. - Uses a Chrome Extension Manifest V3 background service worker to commit the solution to GitHub.
- Names the committed file as
<problem number>. <problem title>.<extension>.
- Create a GitHub personal access token with at least
repoaccess (classic token) or equivalent contents permissions (fine-grained token). - Open
chrome://extensions. - Enable Developer Mode.
- Click
Load unpackedand select this folder. - Open the extension popup.
- Paste the token, connect GitHub, and select the repository that should receive accepted solutions.
- This implementation is event-driven. It reacts to the actual LeetCode
submitandchecknetwork requests instead of polling the page. - The current scaffold commits files to the repository root.
- GitHub authentication is implemented with a personal access token stored in
chrome.storage.local. If you want a full OAuth flow later, that requires registering a GitHub OAuth app and adding the callback flow to the extension.