Copy URL with Title - Firefox Extension

Nov 27, 2024

javascriptfirefoxextension

A simple Firefox extension to copy page URLs with their titles in a format that renders nicely when pasted: https://github.com/brequet/firefox-copy-named-url

Working with my team on Teams, I got tired of pasting URLs that looked like this:

https://addons.mozilla.org/fr/firefox/addon/copy-page-url-with-title/

When I could have something much cleaner like this:

Copy page URL with title – Adoptez cette extension pour 🦊 Firefox (fr)

Browsers like Firefox (I use Zen) can handle rich clipboard content, but there wasn’t a straightforward extension to copy URLs in a format that Teams and similar platforms would render as proper hyperlinks.

How it works

Click the extension icon and it copies both plain text and HTML to your clipboard. The HTML version includes the page title as the link text, which platforms like Teams automatically render as a clickable link instead of raw text.

The extension uses the Clipboard API to write both formats:

  • text/html for rich text applications
  • text/plain as fallback for basic editors

Try it

Available on Mozilla Add-ons: Copy page URL with title

The code

Two files, that’s it:

  • manifest.json declares permissions and sets up the browser action with theme-aware icons.
  • background.js handles the click event, grabs the tab title and URL, then writes formatted HTML and plain text to the clipboard.