A Thunderbird extension that adds an "Open in Gmail" button to quickly view the current email in the Gmail web interface.
- One-click access: Opens the current email in Gmail web interface with a single click
- Smart Message-ID lookup: Uses RFC822 Message-ID for accurate email matching
- Fallback search: If Message-ID is unavailable, searches by subject and sender
- Native integration: Button appears directly in the message display header
- Cross-platform: Opens in your default system browser on macOS, Linux, and Windows
- Download the latest
open-in-gmail.xpifile - In Thunderbird, go to Tools > Add-ons and Themes (or press
Cmd+Shift+A) - Click the gear icon ⚙️ and select Install Add-on From File...
- Select the downloaded
.xpifile - Click Add to confirm
# Clone or download the source code
cd open-in-gmail
# Package the extension
./package.sh
# Install the generated .xpi file in Thunderbird- Open any email in Thunderbird
- Look for the Gmail icon button in the message header area
- Click the button to open the email in Gmail
- Your default browser will open with the email displayed
- Thunderbird: Version 78.0 or later
- Gmail account: The email must exist in your Gmail or Google Workspace account
- Operating System: macOS (tested), Linux, Windows
The extension uses two methods to locate emails in Gmail:
- Primary Method - Message-ID: Extracts the RFC822 Message-ID from email headers and uses Gmail's
rfc822msgid:search operator - Fallback Method: If Message-ID is unavailable, constructs a search query using the subject line and sender email
https://mail.google.com/mail/?authuser=<email>#search/rfc822msgid:<message-id>
├── manifest.json # Extension metadata and configuration
├── background.js # Core logic and Gmail URL construction
├── icons/ # Extension icons (16x16, 32x32, 48x48, 96x96)
├── tests/ # Unit tests
│ └── test.js # Test suite
├── README.md # This file
└── package.sh # Build script
node tests/test.jsAll tests should pass:
- Message-ID extraction tests (8 tests)
- Gmail URL construction tests (5 tests)
- Fallback URL construction tests (5 tests)
- Integration tests (1 test)
./package.shThis creates open-in-gmail.xpi in the current directory.
- Open Tools > Developer Tools > Debug Add-ons
- Load the extension temporarily for testing
- View logs in Tools > Developer Tools > Browser Console
This extension requires the following permissions:
- messagesRead: To access email headers and metadata
- accountsRead: To look up the account email for the
authuserparameter
These permissions are only used to read the current email's Message-ID and open the Gmail URL.
- Gmail account required: The email must exist in your Gmail or Google Workspace account
- Multiple accounts: Uses the account email as the
authuserparameter; may not work if you have multiple Google accounts signed in to the browser - Deleted emails: Won't find emails that have been deleted from Gmail
- Search accuracy: Fallback search may show multiple results if subject/sender aren't unique
- Initial release
- Message-ID based email lookup; fallback search by subject and sender
- Gmail and Google Workspace account support
- Button enabled/disabled based on whether the active message is from a Gmail account
- Gmail logo icon with external-link arrow badge