A Chrome extension that creates Gmail links anyone can use. Unlike regular Gmail URLs, these links work for anyone who received the email - not just you.
- 🔗 Links That Work For Everyone - Unlike copying Gmail's URL, these links open the email for anyone who received it
- 🎯 Multiple Locations - Buttons appear throughout Gmail for easy access
- 📋 One-Click Copying - Click the button and share the link with your team
- ⚙️ Customizable - Enable/disable buttons in different Gmail views via settings
- 🔒 Privacy-First - Read-only access, no data collection, local processing only
- 🎨 Polished UI - Beautiful design inspired by Mindful healthcare aesthetic
Coming soon: Screenshots of buttons in Gmail, popup, and options page
- Google Chrome or Chromium-based browser
- Google Cloud Console account (for OAuth setup)
- Gmail account
- Go to Google Cloud Console
- Create a new project (or select existing)
- Enable the Gmail API for your project
- Navigate to Credentials → Create Credentials → OAuth 2.0 Client ID
- Choose Chrome Extension as application type
- Set Authorized redirect URI to:
(You'll get the extension ID after step 2.5)
https://<YOUR_EXTENSION_ID>.chromiumapp.org/ - Copy the Client ID
-
Clone this repository:
git clone <repository-url> cd gmail-deeplinker
-
Configure OAuth Client ID:
- Open
manifest.json - Replace the
client_idvalue with your OAuth Client ID from step 1.7
- Open
-
Load in Chrome:
- Open Chrome and navigate to
chrome://extensions - Enable Developer mode (toggle in top-right corner)
- Click Load unpacked and select this folder
- Copy the Extension ID from the extension card
- Open Chrome and navigate to
-
Update OAuth Redirect URI:
- Go back to Google Cloud Console → Credentials
- Edit your OAuth Client ID
- Update the redirect URI with your actual extension ID from step 2.3
- Save changes
-
Reload the Extension:
- Go back to
chrome://extensions - Click the reload icon on your extension card
- Go back to
- Open Gmail
- You should see "Copy shareable link" buttons next to messages and threads
- Click a button - you'll be prompted to authorize the extension (first time only)
- After authorization, the shareable link will be copied to your clipboard
- Share the link with anyone who received the email - it will work for them too!
When you copy a Gmail URL from your browser, it only works for you. If you send it to someone else who received the same email, it won't work - Gmail shows them a different URL.
This extension creates special links using the email's unique Message-ID. These links work for anyone who has access to the email, whether they were in the To, CC, or BCC fields.
The extension creates links using Gmail's RFC822 Message-ID search:
https://mail.google.com/mail/#search/rfc822msgid%3A<message-id>
Example:
https://mail.google.com/mail/#search/rfc822msgid%3ACAH%3Dj8u4kZ...%40mail.gmail.com
- Universal Access - Works for anyone who received the email (To, CC, or BCC)
- Stable - Links never break, even when emails are archived or forwarded
- No Account Issues - Unlike regular Gmail URLs, these work regardless of which Gmail account someone is using
- Easy Sharing - Share links with your team, and they'll actually work
User clicks "Copy link"
↓
Content script (content.js) sends message to service worker
↓
Service worker (service-worker.js) fetches Message-ID via Gmail API
↓
Deep link generated and cached (2-minute TTL)
↓
Link copied to clipboard
↓
Toast notification shows success
- Quick Settings: Click the extension icon in the Chrome toolbar
- Full Options: Right-click the extension icon → Options
- Conversation View - Show/hide "Copy shareable link" buttons next to individual messages
- Thread List View - Show/hide "Copy shareable link" buttons in your inbox list
Settings are synced across all your Chrome devices via chrome.storage.sync.
gmail-deeplinker/
├── manifest.json # Extension configuration (Manifest V3)
├── service-worker.js # OAuth, Gmail API calls, caching
├── content.js # Gmail DOM observation, button injection
├── content.css # Injected button styles
├── popup.html/js # Extension popup (quick settings)
├── options.html/js # Full options page
├── shared.css/js # Reusable design system & components
├── logo/ # Extension icons (16-512px)
├── build.js # Build script for minification & optimization
├── package.json # NPM dependencies and build scripts
├── agents_context/ # AI agent documentation
│ ├── ARCHITECTURE.md
│ ├── CLAUDE.md
│ ├── DESIGN_SYSTEM_REFERENCE.md
│ └── UI_OVERHAUL_SUMMARY.md
└── README.md # This file
- Vanilla JavaScript (ES6+) - No frameworks, minimal dependencies
- Chrome Extension Manifest V3 - Latest extension platform
- Gmail API - OAuth 2.0 for Message-ID retrieval
- Mindful Design System - Healthcare-inspired aesthetic
- esbuild - Fast JavaScript/CSS minification
- SVGO - SVG optimization
To create an optimized, production-ready ZIP file for the Chrome Web Store:
-
Install dependencies:
npm install
-
Build and package:
npm run pack
This will:
- Minify all JavaScript files (removes comments, whitespace)
- Minify all CSS files
- Optimize SVG files (typically 60-70% size reduction)
- Copy all necessary assets
- Remove the unused
scriptingpermission from manifest - Create
gmail-link-share.zipin the project root
Expected output:
- Source size: ~520 KB
- Optimized size: ~170 KB (67% reduction)
- Final ZIP: ~108 KB
-
Upload to Chrome Web Store:
- Go to Chrome Web Store Developer Dashboard
- Upload
gmail-link-share.zip
Available NPM scripts:
npm run build- Build optimized files todist/directorynpm run pack- Build + create ZIP file for distributionnpm run clean- Removedist/and ZIP file
- Make changes to source files
- Reload extension at
chrome://extensions(click reload icon) - Test in Gmail - Refresh Gmail to see changes
- Check console logs:
- Service worker: Click "service worker" link in
chrome://extensions - Content script: Open DevTools (F12) in Gmail
- Service worker: Click "service worker" link in
Note: For development, you can load the extension directly from the project root (unpacked). Only use the build process when preparing for distribution.
Service Worker Console:
chrome://extensions→ Find extension → Click "service worker"- View OAuth token flow, API responses, cache behavior
Content Script Console:
- Open Gmail → Press F12 → Console tab
- View DOM mutations, button injection, clipboard operations
Common Issues:
- "Failed to copy link": Make sure you've authorized the extension and the Gmail API is enabled
- Buttons not appearing: Try refreshing Gmail or reloading the extension
- Clipboard fails: Click on Gmail first to give it focus, then try again
See ARCHITECTURE.md for detailed technical documentation.
- ✅ Message-ID headers only (via Gmail API)
- ✅ Gmail DOM for button injection
- ❌ No email content or bodies
- ❌ No personal information
- ✅ User settings (conversation/list view toggles) in
chrome.storage.sync - ✅ Message-IDs cached in memory for 2 minutes
- ❌ No email content
- ❌ No persistent message data
- Read-only OAuth scope - Cannot send, delete, or modify emails
- Content Security Policy - Prevents code injection attacks
- No external servers - All processing happens locally
- No tracking - Zero analytics or telemetry
- Minimal permissions - Only what's required for core functionality
| Permission | Why We Need It |
|---|---|
identity |
OAuth 2.0 authentication with Google |
storage |
Save your preference settings |
activeTab |
Access Gmail's DOM when you're viewing it |
mail.google.com |
Inject our buttons into Gmail's interface |
gmail.googleapis.com |
Fetch Message-ID headers via Gmail API |
- Gmail Web Only - Links work anywhere, but buttons only appear in Gmail web (not mobile apps)
- Recipients Only - Links only work for people who received the email (To, CC, or BCC)
- Chrome/Chromium Only - Currently only available for Chrome-based browsers
- Authorization Required - You need to authorize the extension to access your Gmail
- Keyboard shortcut for copying shareable link (e.g.,
Ctrl+Shift+L) - Clearer error messages when links can't be created
- Live settings updates without refreshing Gmail
- Copy multiple links at once
- Link format options (Markdown, HTML, plain text)
- Preview links before copying
- Dark mode support
- See how many links you've copied
- Alternative link formats
See CLAUDE.md for complete enhancement list.
- ARCHITECTURE.md - Technical architecture and data flow
- CLAUDE.md - AI agent development guide
- DESIGN_SYSTEM_REFERENCE.md - UI component library
- UI_OVERHAUL_SUMMARY.md - Design system implementation
- Design inspired by Mindful Healthcare Template
- Built on Chrome Extension v3 Starter by SimGus
See LICENSE file for details.
- Report bugs: Open an issue in the GitHub repository
- Setup help: See ARCHITECTURE.md for detailed OAuth setup
- Questions: Check the README or open an issue
Version: 1.0.0
Last Updated: 2025-01-11
Manifest Version: 3
Minimum Chrome: 88+