Skip to content

KieranHunt/link-mage

Repository files navigation

Link Mage

Summon ✨ magical links ✨

A browser extension that captures the active tab as a shareable Link and places it on the system clipboard, ready to paste into chat apps, docs, and markdown editors.

What it does

Press a single keystroke (or click the toolbar icon) and the current page lands on your clipboard as a Link in two forms:

  • Rich text form<a href="url">title</a>, written to the clipboard's text/html slot. Pastes into Notion, Slack, Gmail, or Word as a clickable, formatted link.
  • Markdown form[title](url), written to the clipboard's text/plain slot. Pastes into Obsidian, GitHub issues, or a code editor as readable markdown.

Whichever form the paste target prefers, it gets a useful representation. You don't pick.

A small pipeline of site-specific transformers cleans up the link text where the raw page title isn't quite right — for example, stripping YouTube's (69) unread-notification prefix from watch-page titles.

Install

Use

  • Press Alt+Shift+L to summon a Link from the active tab.
  • Or click the 🧙 toolbar icon.
  • The icon flashes ✅ on success and ❌ on failure (e.g. on restricted pages like about:config, the new tab page, or addons.mozilla.org, where extensions can't reach).

Build from source

Reproduces the published dist/ directory that ships inside the .xpi.

Prerequisites

  • Bun 1.3.14 (pinned in mise.toml). If you use mise, mise install picks it up automatically. Otherwise install Bun 1.3.14 directly.

Build

bun install
bun run build

Output lands in dist/:

  • dist/manifest.json — copied verbatim from public/manifest.json
  • dist/background.js — bundle of src/background.ts
  • dist/copy-link.js — bundle of src/copy-link.ts (IIFE format, loaded as a content script)
  • dist/icons/ — copied verbatim from public/icons/

Package for distribution

bun run package         # produces web-ext-artifacts/link-mage-1.0.0.xpi
bun run package:source  # produces web-ext-artifacts/link-mage-source-1.0.0.zip

The .xpi is what gets uploaded to AMO. The source zip is what AMO's reviewer uses to reproduce the build.

Develop

bun run dev:firefox     # build, watch sources, run a Firefox dev profile
bun run dev:chromium    # same, against Chromium

Verify

bun run typecheck       # tsc --noEmit
bun run lint:ext        # web-ext lint against dist/

web-ext lint will always emit one MANIFEST_FIELD_UNSUPPORTED warning about /background/service_worker. That's expected — see ADR-0001.

Release

  1. Bump the version in public/manifest.json and package.json (keep both in sync). Semver — patch for bugfixes, minor for features, major for breaking changes.
  2. Commit and push to main.
  3. In GitHub: Actions → Release → Run workflow.

The workflow typechecks, lints, builds, signs and uploads the .xpi to the AMO listed channel, tags the commit v<version>, and creates a GitHub release with auto-generated notes. It refuses to run if the tag already exists.

Updates appear on the AMO listing after Mozilla's review.

One-time prerequisites:

Project layout

  • CONTEXT.md — domain glossary (Page, Link, Summon, Transformer, etc.). Read this first if you're contributing.
  • docs/adr/ — architecture decision records explaining the cross-browser manifest, the synthetic-copy-event clipboard pattern, and the bundled-content-script pipeline.
  • src/ — TypeScript sources for the background script, content script, and transformer pipeline.
  • public/ — static assets copied verbatim into the build: manifest.json and icons/.
  • scripts/ — icon generator and source-zip packager.

Support

File issues at https://github.com/KieranHunt/link-mage/issues.

License

MIT © 2026 Kieran Hunt

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors