elmarco/firefox-gmailid

A Firefox extension to copy the MessageId of a mail in gmail

★ 0Forks 0JavaScriptGitHub ↗Compare

README

Gmail Message-ID Copier

A Firefox extension that copies the RFC 2822 Message-ID of the currently viewed Gmail message to the clipboard.

Useful when you need to reference a specific email in bug trackers, mailing list archives, or notmuch/mu searches.

Features

  • Click the toolbar icon while viewing a Gmail message to copy its Message-ID
  • Keyboard shortcut: Alt+M
  • Works with multi-account Gmail (/mail/u/0/, /mail/u/1/, etc.)

Installation

Temporary (for development/testing)

  1. Open about:debugging#/runtime/this-firefox in Firefox
  2. Click Load Temporary Add-on...
  3. Select any file in this directory (e.g. manifest.json)

The extension will remain active until you restart Firefox.

Permanent (unsigned)

To install permanently without going through AMO, you need Firefox Developer Edition or Nightly, with xpinstall.signatures.required set to false in about:config.

  1. Zip the extension files:
    zip -r gmail-message-id-copier.xpi manifest.json content.js popup.html popup.js background.js icon.svg
  2. Open about:addons in Firefox
  3. Click the gear icon and select Install Add-on From File...
  4. Select the .xpi file

Permanent (signed via AMO)

Submit the extension at addons.mozilla.org for signing. You can choose "self-distribution" (unlisted) to get a signed .xpi without publishing it publicly.

Usage

  1. Open a message in Gmail
  2. Click the Copy Message-ID toolbar icon, or press Alt+M
  3. The Message-ID is now in your clipboard (e.g. [email protected])

How it works

The extension injects a content script into Gmail that:

  1. Extracts Gmail's internal session key (ik) and the current message identifier from the DOM
  2. Fetches the raw RFC 2822 message source via Gmail's ?view=om endpoint
  3. Parses the Message-ID header from the raw email headers

Files

File Purpose
manifest.json Extension manifest (Manifest V3)
content.js Content script injected into Gmail — extracts and parses Message-ID
popup.html/js Browser action popup — triggers extraction and shows result
background.js Handles the Alt+M keyboard shortcut
icon.svg Toolbar icon

Contributors

elmarco

Issues