How priyanshuk001/codehint-ai works
CodeHint AI is a browser extension that brings AI assistance into supported coding-problem pages. The user opens the popup or floating panel, selects an action, and the extension gathers problem context (and, where needed, editor code or test cases), sends a request to the background AI handler, and presents the response; generated code can be inserted into the editor. Site adapters normalize page-specific data, while a page-world bridge provides access to embedded editors. The README documents the supported sites and assistance modes; some implementation details are unsampled, so those links are shown only where documented.
Main entry points: content.js Page assistant · registry.js Site registry · background.js AI request handler · popup.js Toolbar popup
Components 16
User interface
- Toolbar popup
popup.js - Page assistant
content.js - Saved settings
Problem sites
- Site registry
core/registry.js - LeetCode adapter
sites/leetcode.js - Codeforces adapter
sites/codeforces.js - CodeChef adapter
sites/codechef.js - GeeksforGeeks adapter
sites/gfg.js - InterviewBit adapter
sites/interviewbit.js - Shared page parsing
core/site-utils.js
Editor access
- Editor access API
core/editors.js - Page-world bridge
core/page-bridge.js
AI assistance
- AI request handler
background.js - OpenAI API
- Google Gemini API
Other components
- Learner
Connections 23
- Learner → Toolbar popup: opens
README.md - Learner → Page assistant: opens
README.md - Toolbar popup → Saved settings: reads and saves
popup.js - Page assistant → Saved settings: reads and saves
content.js - Toolbar popup → Page assistant: requests page context
popup.js - Page assistant → Site registry: uses active adapter
README.md - Site registry → LeetCode adapter: selects for page
core/registry.js - Site registry → Codeforces adapter: selects for page
core/registry.js - Site registry → CodeChef adapter: selects for page
README.md - Site registry → GeeksforGeeks adapter: selects for page
README.md - Site registry → InterviewBit adapter: selects for page
README.md - LeetCode adapter → Shared page parsing: parses shared fields
- Codeforces adapter → Shared page parsing: uses helpers
sites/codeforces.js - GeeksforGeeks adapter → Shared page parsing: uses helpers
sites/gfg.js - Page assistant → Editor access API: reads and inserts code
README.md - Editor access API → Page-world bridge: dispatches editor requests
core/editors.js - Page-world bridge → Editor access API: returns editor data
core/page-bridge.js - Toolbar popup → AI request handler: sends AI requests
popup.js - Page assistant → AI request handler: sends AI requests
content.js - AI request handler → OpenAI API: calls when selected
background.js - AI request handler → Google Gemini API: calls when selected
background.js - AI request handler → Toolbar popup: returns assistance
- AI request handler → Page assistant: returns assistance