Skip to content

cooperrobillard/connection-note-draft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connection Note Draft

Connection Note Draft is a minimal Manifest V3 Chrome extension that drafts one concise connection note from a LinkedIn profile page using the OpenAI API. It reads a small set of visible profile sections, generates one short note that starts with your saved intro, and leaves the final send action to the user.

Why This Exists

Writing a thoughtful connection request is usually a small task, but it still requires reading the profile, picking one relevant detail, and phrasing a note that sounds natural. This project keeps that workflow lightweight: it surfaces a compact in-tab panel, generates one clean draft, and avoids turning the experience into a prompt playground or bulk automation tool.

Current Feature Set

  • Works on LinkedIn profile pages only.
  • Injects a floating Note chip that opens a compact in-tab panel.
  • Generates one connection note at a time.
  • Lets the user regenerate the note or copy it.
  • Stores only an OpenAI API key and a persistent Default Intro in settings.
  • Uses visible profile text from the hero, about, and current experience areas as generation context.
  • Runs entirely client-side apart from the OpenAI API request.

How It Works

  1. Open a LinkedIn profile page.
  2. Click the floating Note chip.
  3. The content script extracts a few visible text sections from the page.
  4. The service worker sends those section texts plus the saved intro to OpenAI.
  5. The extension returns one short note in the panel.
  6. Click Copy and paste the note manually if you want to use it.

Current UX

  • LinkedIn profile pages only
  • Floating Note chip
  • One generated note box
  • Generate
  • Copy

The extension does not auto-send messages, auto-connect, or perform bulk actions.

Settings

The options page exposes only:

  • API Key
  • Default Intro

Example Default Intro:

Hi, I'm [Your Name], [School/Company], [Role].

That intro is persisted with chrome.storage.sync and used at the start of every generated note.

Extraction Strategy

The scraper is intentionally section-based rather than heavily structured.

It primarily reads:

  • name
  • firstName
  • headline
  • heroText
  • aboutText
  • currentExperienceText
  • optional supporting educationText

Instead of forcing a rigid role/company/bullet model up front, the extension captures a few high-signal visible text blocks and lets the model infer the most relevant detail to mention. This keeps the scraper narrower and reduces brittle assumptions from the current page DOM.

Generation Strategy

  • The service worker receives the extracted section text plus the saved intro.
  • The prompt asks the model to choose one natural, specific detail from the provided text.
  • The generated note starts with the saved intro.
  • The result is normalized into one concise note for display.
  • If the model response is weak, the extension falls back to a deterministic short note built from the same extracted text.

The intended output style is short, natural, and specific, not robotic or overly formal.

Repo Structure

manifest.json
options/
  options.html        Options page UI
  options.js          Settings persistence
popup/
  popup.html          Minimal launcher with settings link
src/
  content.js          In-tab panel lifecycle and generation flow
  heuristics.js       Raw section-text extraction on profile pages
  inject.css          Injected panel styles
  service_worker.js   OpenAI request flow, prompt building, note cleanup
README.md
LICENSE

Installation

  1. Clone or download this repository.
  2. Open Chrome and go to chrome://extensions.
  3. Turn on Developer mode.
  4. Click Load unpacked.
  5. Select the project folder.
  6. Open a LinkedIn profile page and use the Note chip.

Local Setup

  1. Load the unpacked extension in Chrome.
  2. Open the extension options page.
  3. Add your OpenAI API key.
  4. Set your preferred Default Intro.
  5. Navigate to a LinkedIn profile page and generate a note.

Privacy, Safety, and Constraints

  • User-triggered only
  • Reads visible content only
  • No auto-connect or auto-send behavior
  • No bulk scraping or background crawling
  • No external database or hosted backend
  • API key and settings are stored locally with chrome.storage.sync
  • Profile content is only sent to OpenAI when the user generates a note

Architecture Flow

Content scripts

  • src/heuristics.js extracts raw visible text from a small set of relevant profile sections.
  • src/content.js injects the chip/panel UI, handles panel state, and sends generation requests.

Background worker

  • src/service_worker.js loads settings, builds the prompt, calls OpenAI, normalizes the response, and returns one note.

UI

  • src/inject.css styles the floating chip and compact note panel.
  • options/options.html and options/options.js provide the settings page.

Development Notes

  • The extension is designed for LinkedIn profile URLs under /in/.
  • The site is a dynamic SPA, so selector maintenance may be needed if the DOM changes.
  • Lower sections may require a short scroll or a quick retry if the page has not rendered them yet.
  • Service worker logs can be inspected from chrome://extensions.

Current Limitations

  • Requires a user-supplied OpenAI API key.
  • Relies on visible profile content and the current page DOM structure.
  • Drafts the note only; the user still copies and pastes it manually.

Possible Future Improvements

  • Add lightweight DOM snapshot fixtures for scraper regression testing.
  • Add stronger end-to-end verification around profile route changes and note generation.
  • Improve packaging and release docs for Chrome Web Store preparation.

License

This project is licensed under the MIT License. See LICENSE.

About

Minimal MV3 Chrome extension that drafts concise, AI-assisted LinkedIn connection notes from visible profile content.

Topics

Resources

License

Stars

Watchers

Forks

Contributors