A powerful Chrome extension that uses AI to generate thoughtful comments on LinkedIn posts with just one click.
- AI-Powered Comments: Generate contextually relevant comments based on the post content
- Multiple AI Providers: Support for both OpenAI (GPT) and Google Gemini models
- Multiple Comment Styles: Choose between short, long, or emoji-enhanced comments
- Tone Selection: Select from various comment tones (Professional, Casual, Supportive, Thoughtful, Enthusiastic)
- Seamless Integration: Works directly within LinkedIn's interface
- Customizable API: Use your preferred AI service by configuring the API key
- Smart Extraction: Accurately extracts post content from LinkedIn's complex DOM structure
- Modern UI: Clean, intuitive interface with smooth animations and helpful notifications
- Clone this repository to your local machine:
git clone https://github.com/yourusername/linkedin-ai-auto-commenter.git - Open Google Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" using the toggle in the top right corner
- Click "Load unpacked" and select the folder where you cloned the repository
- The extension should now appear in your extensions list and is ready to use!
- Download the extension files from the Releases page
- Unzip the downloaded file to a location of your choice
- Follow steps 2-5 from the "From Source" section above
- Navigate to any LinkedIn post
- Click the "Comment" button below the post
- A toolbar will appear with the following options:
- Tone Selector: Choose the tone of your comment (Professional, Casual, etc.)
- Short: Generate a concise comment
- Long: Generate a more detailed comment
- Emoji+: Generate a comment with relevant emojis
- Reset: Clear the comment field
- Click any of the comment style buttons to generate an AI-powered comment
- Review and edit the generated comment as needed before posting
- Click the extension icon in your Chrome toolbar
- Select "Options" from the dropdown menu
- Choose your preferred AI provider (OpenAI or Google Gemini)
- Enter your API key in the designated field
- Select the model you want to use (or use the default)
- Save your changes
- Sign up or log in to your OpenAI account
- Navigate to the API keys section
- Create a new API key
- Copy the key and paste it into the extension options
- Sign up or log in to your Google AI Studio
- Navigate to the API keys section
- Create a new API key
- Copy the key and paste it into the extension options
The extension supports both OpenAI and Google Gemini models. Make sure your API key is valid and has sufficient credits for generating comments.
- manifest.json: Extension configuration file
- content.js: Handles DOM interaction and UI elements
- background.js: Manages API requests and response processing
- options.html/js: Provides the options interface for configuration
The extension uses multiple selectors to accurately extract post content from LinkedIn's complex DOM structure:
- Primary: Targets the nested span with
dir="ltr"inside the break-words container - Secondary: Tries the innermost span in the break-words container
- Tertiary: Falls back to the parent span in the break-words container
- Final: Attempts to extract from any break-words span
The extension sends the extracted post content along with the selected style and tone to the configured AI service, which generates an appropriate comment based on these parameters.
Contributions are welcome! If you'd like to contribute to this project:
- Fork the repository
- Create a new branch for your feature (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow the existing code style and conventions
- Add comments to explain complex functionality
- Test your changes thoroughly before submitting
- Ensure all UI elements are responsive and accessible
- Update documentation as needed
When reporting issues, please include:
- Chrome version and OS
- Extension version
- Steps to reproduce the issue
- Expected vs. actual behavior
- Screenshots if applicable
- Any error messages from the console
This project is licensed under the MIT License. See the LICENSE file for details.
This extension is an independent project and is not affiliated with, endorsed by, or connected to LinkedIn Corporation. Users are responsible for the content they post and should ensure compliance with LinkedIn's User Agreement and Community Guidelines.
- Thanks to the open-source community for various tools and libraries that made this extension possible
- Special thanks to all contributors who have helped improve this project
Extension not loading properly:
- Make sure you're using a recent version of Chrome
- Try disabling and re-enabling the extension
- Check for any error messages in the Chrome extension console
Comments not generating:
- Verify your API key is correct and has sufficient credits
- Check your internet connection
- Try switching to a different AI model
Can't find the comment toolbar:
- Make sure you've clicked on a comment button first
- Try refreshing the LinkedIn page
- Check if the extension is enabled in Chrome extensions
To enable debug mode:
- Right-click the extension icon
- Select "Inspect popup"
- In the console, type:
localStorage.setItem('debug', 'true') - Reload the LinkedIn page
This will enable additional logging to help diagnose issues.
If you encounter any issues or have suggestions for improvement:
- Check the Issues page for known problems
- Create a new issue if your problem hasn't been reported yet
- Provide as much detail as possible about the issue, including screenshots if applicable