LinkedIn outreach can feel like a chore, especially when every connection request starts with a blank message box. Even the most polished greetings often land in the ignored pile, while truly personalized messages—though effective—demand time and effort that few professionals can spare. What if you could automate the entire process without sacrificing authenticity?
That’s the question one developer answered by creating ConnectAI, a Chrome Extension that scrapes LinkedIn profiles and generates three tailored connection requests using the Anthropic Claude API. The tool streamlines outreach by pulling specific details from a profile—such as job title, company, and recent activity—and crafting messages that feel human-written, not robotic.
How ConnectAI Works: From Scraping to Delivery
The extension operates in four key stages, each designed to ensure efficiency and compliance with LinkedIn’s evolving platform.
1. LinkedIn Profile Scraping
ConnectAI’s content script activates on any LinkedIn profile page (linkedin.com/in/*) and extracts critical details such as:
- Full name and professional headline
- Current role and employer
- Top three listed skills
- A snippet of recent activity
- Profile URL
To handle LinkedIn’s dynamic React-based interface—which frequently updates class names and element structures—the tool employs multiple fallback selectors for each data point. This redundancy ensures reliable scraping even when LinkedIn alters its DOM structure.
For example, the extension targets headers like h1.text-heading-xlarge or h1[class*='heading'] to capture the user’s name, while roles are pulled from .text-body-medium.break-words or .pv-top-card .text-body-medium. The scraped data is then stored locally using chrome.storage.local for quick access.
2. Secure API Communication via Background Service Worker
Direct API calls from the popup to external services like Anthropic’s Claude are blocked by Cross-Origin Resource Sharing (CORS) policies in Manifest V3 extensions. To bypass this limitation, ConnectAI routes all requests through the background service worker using chrome.runtime.sendMessage.
This approach ensures smooth communication between the popup UI and the AI while maintaining security and compliance with Chrome’s extension guidelines. The service worker listens for messages of type GENERATE_MESSAGES, processes the request, and returns the generated content asynchronously.
3. AI-Powered Message Generation with Claude
The heart of ConnectAI lies in its prompt engineering, which guides the AI to produce concise, context-aware messages. The system prompt enforces strict rules to avoid clichés and maintain a natural tone:
- Each message must stay under 300 characters (LinkedIn’s limit)
- Avoid phrases like "I came across your profile"
- Reference something specific from the target’s profile
- Sound like a peer, not a salesperson
- Return output in a strict JSON format
The developer refined these prompts through iterative testing to balance brevity with personalization, ensuring every message feels authentic rather than algorithmically generated.
4. User-Friendly Popup Interface
The extension’s popup—measuring 420 pixels wide and featuring a dark theme—displays all essential information in a single view:
- Scraped profile details (name, role, company, etc.)
- Editable sender information (name, title, company)
- Four purpose options (e.g., networking, referral, collaboration)
- A "Generate" button to trigger message creation
- Three message cards with real-time character count indicators
Character limits are visually highlighted:
- Green for messages under 300 characters (safe to send)
- Red for messages exceeding the limit (requires editing)
A one-click copy button allows users to paste the generated message directly into LinkedIn’s compose box.
Technical Challenges and Solutions
Building a functional Chrome Extension for LinkedIn required overcoming several hurdles unique to the platform.
1. Navigating LinkedIn’s React-Driven DOM
LinkedIn’s single-page application (SPA) architecture means the DOM updates dynamically as users navigate. To handle this, the extension uses a MutationObserver to trigger rescraping whenever the page content changes. This ensures the data remains current even after profile updates or in-page transitions.
2. CORS Restrictions in Manifest V3
Unlike earlier extension versions, Manifest V3 imposes stricter CORS policies. Direct API calls from the popup to external services are prohibited, necessitating the use of a background service worker as an intermediary. This architectural shift added complexity but was essential for the tool’s functionality.
3. Ensuring Consistent AI Output
Claude occasionally wraps its JSON responses in markdown code fences (e.g., ```json ... ``), complicating parsing. The developer implemented a **cleaning step** to strip these artifacts before JSON.parse()` attempts, with a fallback regex extraction to handle edge cases.
The Tech Stack Behind ConnectAI
ConnectAI leverages a lightweight but powerful combination of technologies:
- Extension Platform: Chrome Extension Manifest V3
- Language: Vanilla JavaScript (no bundler required)
- AI Integration: Anthropic Claude API
- Storage: Chrome’s built-in
storage.localAPI - Scraping: Content scripts with MutationObserver
- Styling: Pure CSS with a dark theme for reduced eye strain
What’s Next for ConnectAI?
The developer has outlined several enhancements to expand the tool’s capabilities:
- Auto-detect outreach purpose based on profile context (e.g., job title, industry)
- Message history tracking per profile for follow-ups and analytics
- Custom tone settings to match the user’s communication style
- Firefox support for cross-browser compatibility
How to Try ConnectAI
ConnectAI is available for free on the Chrome Web Store, though users will need a valid Anthropic API key to generate messages. New API accounts receive $5 in free credits, sufficient for approximately 500 message generations—enough to test the tool extensively.
The project is also open-source on GitHub, inviting contributions from developers who’ve tackled similar challenges with LinkedIn’s platform. If you’ve built Chrome Extensions before, the developer encourages sharing your approach to handling DOM changes in the comments.
Automating LinkedIn outreach isn’t just about saving time—it’s about increasing the likelihood of meaningful connections. As AI tools like ConnectAI evolve, professionals may soon redefine how they network, turning once-laborious tasks into effortless, personalized interactions.
AI summary
LinkedIn’e kişiselleştirilmiş iletiler göndermek için saatler harcamanıza gerek kalmadı. İşte profesyonel bağlantılarınızla etkili iletişim kurmanızı kolaylaştıracak yeni bir Chrome eklentisi ve nasıl çalıştığı.