Copy PR Link for Slack
A tiny browser extension (Chrome & Firefox) that adds a Slack-logo button to GitHub pull request pages. Click it and the PR is copied to your clipboard as:
:opened:PR title (#123) ← hyperlinked to the PR URL
Paste into Slack and you get the :opened: emoji followed by the PR title (with
its number) as a clean clickable link, instead of a bare URL. The emoji is plain
text outside the link, so Slack renders it as the emoji.
Install
From a release (no cloning)
Download the latest zips from the Releases page:
- Chrome / Edge / Brave / Arc — download
chrome.zip, unzip it, openchrome://extensions, enable Developer mode, click Load unpacked, and select the unzipped folder. - Firefox — install from
addons.mozilla.org
(signed, auto-updates). To try an unsigned build instead, download
firefox.zip, openabout:debugging#/runtime/this-firefox, click Load Temporary Add-on…, and selectfirefox.zip(temporary add-ons clear on restart).
From source (load unpacked)
shared/ is the single source of truth. The chrome/ and
firefox/ folders are assembled from it, so run the build once to
populate them with real files (Chrome won't load a folder whose files are
symlinks pointing outside it — see Project layout):
pnpm install
pnpm build
- Chrome:
chrome://extensions→ Developer mode → Load unpacked → thechrome/folder. - Firefox:
about:debugging#/runtime/this-firefox→ Load Temporary Add-on… →firefox/manifest.json.
Then open any GitHub PR — a Slack-logo button appears in the title row, right
after the Edit title button. After editing shared/, re-run pnpm build and reload
the extension (Chrome: ↻ on the card; Firefox:
Reload in about:debugging).
Usage
- Go to a pull request, e.g.
https://github.com/owner/repo/pull/123. - Click the Slack-logo button (it briefly shows a ✓).
- Paste into the Slack message box. You'll see the emoji + the PR title as a hyperlink.
The link always points at the canonical PR URL, so it works from any PR sub-tab (Conversation, Files changed, Commits, …).
How it works
- A content script runs only on
https://github.com/*/*/pull/*. - On click it reads the PR title from the page (stripping UI controls like the
"Edit title" button) and builds the canonical PR URL from the path, then writes
two clipboard flavors:
text/html→:opened: <a href="https://github.com/balazsorban44/slack-copy-pr-link/blob/HEAD/URL">Title (#123)</a>(what Slack and other rich editors use)text/plain→:opened: Title (#123)+ newline +URL(fallback for plain-text targets)
- The button is placed right after the Edit title button (new React header) or in the action bar (classic header), and is re-injected across GitHub's in-page (Turbo/PJAX/React) navigation.
Settings
Click the extension's toolbar icon to open settings and change the message
prefix — the text added before the link. It defaults to the :opened: Slack
emoji shortcode; set any shortcode you like (e.g. :rocket:) or leave it blank
for no prefix. Changes apply immediately, no reload needed.
Tip: pin the extension (puzzle-piece menu → pin) so the icon is always visible.
Customize (code)
Other tweaks live in shared/content.js — reload the
extension after editing. For example, to change the link text, edit getPrInfo()
(e.g. drop the parentheses around the number: `${base} #${number}`).
Project layout
shared/ ← single source of truth, the only committed copy (edit here)
content.js content.css popup.html popup.js icons/
chrome/
manifest.json (committed)
content.js, …, icons/ (generated by scripts/build.sh; git-ignored)
firefox/
manifest.json (committed; adds browser_specific_settings.gecko)
content.js, …, icons/ (generated; git-ignored)
Only each manifest.json is committed per browser; everything else is copied in
from shared/ by scripts/build.sh. We copy real files rather than symlink
because Chrome refuses to load an unpacked extension whose files resolve outside
its root directory (an earlier symlink-based layout broke for exactly this
reason). The same chrome.* (callback-style) APIs and clipboard code work in
both browsers, so only the manifests differ.
Building & releases
Build the installable zips locally:
pnpm install
pnpm build # → dist/chrome.zip, dist/firefox.zip
pnpm lint # AMO validator (web-ext lint) against the Firefox build
Requires Node 24 (see .nvmrc) and pnpm.
A GitHub Actions workflow
(.github/workflows/release.yml) runs on every
push to main: it bumps the patch version in both manifests, commits that back
(chore: release vX.Y.Z [skip ci]), and publishes a GitHub Release with
chrome.zip and firefox.zip attached, then submits the Firefox build to
addons.mozilla.org
via web-ext sign (listing metadata lives in
amo-metadata.json; credentials are the AMO_JWT_ISSUER /
AMO_JWT_SECRET repository secrets). The bump commit is made with
GITHUB_TOKEN, so it doesn't trigger another run.
Permissions
clipboardWrite— to place the link on your clipboard.storage— to remember your message-prefix setting.
No data is collected or sent anywhere; everything runs locally in your browser.
Your prefix setting is stored with chrome.storage.sync.
