A Chrome extension that provides AI-powered text processing capabilities. The extension allows users to select text on a webpage and receive an AI-generated response, displayed in a popup near the selected text.
This extension uses Chrome's Manifest V3 architecture and integrates with Google's Generative Language API to provide AI-powered text analysis and responses.
- AI-powered text processing
- Context-aware responses
- Typing effect for responses
- Position-aware popup display
- Customizable styling
- Content script injection
- Chrome browser (version supporting Manifest V3)
- Internet connection
- Google Generative Language API access
- Clone the repository
- In Chrome, go to chrome://extensions
- Enable "Developer mode"
- Click "Load unpacked" and select the extension directory
- Select text on any webpage
- Right-click the selection (or use the extension's context menu)
- The extension will display an AI-generated response in a popup near the selected text
- The response will be typed out with a typing effect
- Close the popup using the × button
These changes will:
- Add a new settings page where users can manage prompts
- Store prompts in chrome.storage.local
- Allow CRUD operations for prompts through the UI
- Make the context menu dynamic based on stored prompts
- Maintain backward compatibility with default prompts
To use the new functionality:
- Click the extension icon in the toolbar
- Click "Extension Options" or right-click and select "Options"
- Use the settings page to add, view, or delete prompts
- The context menu will automatically update with your custom prompts
The prompts are stored with three components:
- id: Unique identifier for the prompt
- title: What appears in the context menu
- template: The actual prompt template with {text} placeholder
This makes the extension much more flexible and allows users to customize it for their specific needs without touching the code.
- Handles communication between the extension and content scripts
- Manages injection of content scripts and styles
- Implements retry logic for message passing
- Displays the AI response in a position-aware container
- Implements the typing effect for responses
- Handles user interaction (closing the popup)
- Defines the extension's permissions and structure
- Specifies content scripts and styling
- Declares dependencies and required permissions
- Requires Google Generative Language API access
- Limited to Chrome browsers
- The typing effect speed is fixed (20ms per character)
- The popup positioning may need adjustment for certain web pages
- Add user customization for typing speed
- Implement more sophisticated error handling
- Add support for multiple selection contexts
- Improve the styling of the popup container
- Add configuration options for API endpoints
[Your License Here]