A lightweight Chrome/Edge extension that integrates with any web-based chat system (WhatsApp Web, LinkedIn, Gmail, Reddit, etc.). The extension refines draft replies using Google Gemini API by analyzing the previous messages in the conversation thread and returning a polished, context-aware response.
- Context-Aware Refinement: Analyzes conversation history to provide relevant, context-aware suggestions
- Universal Compatibility: Works on all major chat platforms (WhatsApp Web, Gmail, LinkedIn, Reddit, etc.)
- Privacy-Focused: No data stored locally or on servers - uses your own Gemini API key
- Keyboard Shortcuts: Quick access with ALT+X (preview) and ALT+Q (replace)
- Real-time Processing: Fast response times with Google's Gemini 2.5 Flash Lite model
- Customizable System Prompt: Edit the system prompt in Options to control the assistant's behavior
-
Download the Extension
- Clone or download this repository
- Extract the files to a folder on your computer
-
Get a Gemini API Key
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- Copy the API key for later use
-
Install in Chrome/Edge
- Open Chrome or Edge browser
- Go to
chrome://extensions/oredge://extensions/ - Enable "Developer mode" (toggle in top-right corner)
- Click "Load unpacked"
- Select the folder containing the extension files
- The extension should now appear in your extensions list
-
Configure the Extension
- Click on the extension icon in your browser toolbar
- Click "Configure API Key"
- Enter your Gemini API key
- Click "Save Settings"
- Test the connection to ensure it's working
- Follow steps 1-2 from Method 1
- Open Chrome/Edge and go to extensions page
- Enable Developer mode
- Click "Load unpacked" and select the extension folder
- Configure your API key as described above
- Navigate to any chat application (WhatsApp Web, Gmail, LinkedIn, Reddit, etc.)
- Click in a text input field and type your message
- Use keyboard shortcuts:
ALT+X(orCmd+Shift+Pon Mac): Preview refined versionALT+Q(orCmd+Shift+Lon Mac): Replace with refined version
- Text Detection: The extension automatically detects when you're in a text input field
- Context Analysis: It extracts the conversation history from the page (last 1K-2K tokens)
- AI Processing: Sends your draft + context to Google Gemini API for refinement
- Response Handling:
- Preview mode: Shows a popup with original vs refined text
- Replace mode: Directly replaces your draft with the refined version
- WhatsApp Web
- Gmail
- Discord
- Slack
- Microsoft Teams
- And many more chat applications
- Click the extension icon in your browser toolbar
- Click "Configure API Key"
- Enter your Gemini API key from Google AI Studio
- Click "Save Settings"
- Test the connection to verify it's working
- ALT+X: Preview refined reply
- ALT+Q: Replace with refined reply
You can customize these shortcuts in your browser's extension settings.
- No Data Storage: Your messages are only sent to Google's Gemini API
- Your API Key: You control your own API key and usage
- No Tracking: No analytics or user tracking
- Local Processing: All text extraction happens in your browser
- No Third-Party Servers: Direct communication with Google's API only
Extension not working:
- Make sure you're on a supported website
- Ensure you've clicked in a text input field
- Check that the extension is enabled
API errors:
- Verify your API key is correct
- Check that you have sufficient API quota
- Ensure you have an active internet connection
Keyboard shortcuts not working:
- Try refreshing the page
- Check for conflicts with other extensions
- Verify the extension is enabled
No conversation context:
- The extension works best on pages with clear message structures
- Some chat applications may have different DOM structures
- Try on different chat platforms
- Check the browser console for error messages
- Verify your API key is working by testing the connection
- Try on different websites to isolate the issue
- Check that all extension files are properly loaded
chat-refinement-extension/
├── manifest.json # Extension manifest
├── content.js # Content script for DOM manipulation
├── background.js # Background script for API calls
├── popup.html # Extension popup UI
├── popup.js # Popup script
├── options.html # Options/settings page
├── options.js # Options script
├── icons/ # Extension icons
│ ├── icon16.svg
│ ├── icon32.svg
│ ├── icon48.svg
│ └── icon128.svg
└── README.md # This file
- Clone the repository
- No build process required - it's a pure JavaScript extension
- Load as unpacked extension in Chrome/Edge
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
- Initial release
- Basic chat refinement functionality
- Support for major chat platforms
- Google Gemini API integration
- Keyboard shortcuts
- Privacy-focused design
For issues, questions, or contributions, please visit the project repository or create an issue.
Note: This extension requires a Google Gemini API key to function. The API key is free to obtain and use within Google's usage limits.