How vrinda0211/codedistill works
CodeDistill is a Chrome extension for turning selected web text into copyable executable code. The user selects text and chooses either rule-based cleaning or AI cleaning from the context menu; the background handler processes that choice and copies the result. A popup lets users save a Gemini API key locally. The README documents both cleaning modes; the sampled source shows their handling in background.js and key management in popup.js. The graph omits manifest wiring and other unsampled implementation details.
Main entry points: background.js Background handler · popup.js API key settings
Components 10
User interaction
- Selected webpage text
- Context menu
background.js - Background handler
background.js - API key settings
popup.js
Code cleaning
- Rule-based cleaning
background.js - AI cleaning request
background.js
Browser and AI
- Local key storage
- Gemini API
- Clipboard
Other components
- User
Connections 11
- User → Selected webpage text: selects text
- User → Context menu: opens menu
- Context menu → Background handler: dispatches choice
- Background handler → Selected webpage text: reads selection
- Background handler → Rule-based cleaning: runs cleaning
- Rule-based cleaning → Clipboard: copies result
- Background handler → Local key storage: reads key
- API key settings → Local key storage: reads and writes key
- Background handler → AI cleaning request: starts AI cleaning
- AI cleaning request → Gemini API: sends selected text
- AI cleaning request → Clipboard: copies response