Safari and Chrome web extension that copies the active tab URL exactly to the clipboard.
- Click the extension toolbar icon to copy the active tab URL.
- Press
Command+Shift+C(Safari) orAlt+Shift+C(Chrome) to copy the active tab URL. - Shows a popup with "Copied URL" confirmation that closes automatically.
For example, if the active tab is https://google.com, the clipboard receives exactly:
https://google.com
Install the pinned local tools with mise:
mise installBuild the signed generated macOS wrapper:
pnpm dev:macpnpm dev:mac builds the signed app using DEVELOPMENT_TEAM from .env or the shell environment and opens it. Start by copying the example file:
cp .env.example .envThen put your team ID into .env and run:
pnpm dev:macTo open the app again without rebuilding:
pnpm open:macThen enable it in Safari:
- Open Safari.
- Go to Settings > Extensions.
- Enable Copy URL.
- Pin or show the extension button in the toolbar if Safari hides it.
Build the Chrome Web Store zip:
pnpm build:chromeThis copies web-extension/, patches the manifest (generic description, Alt+Shift+C shortcut), and outputs dist/graburl-chrome-v<version>.zip. Load the unpacked dist/chrome/ folder in chrome://extensions (developer mode) for local testing.
pnpm testThe extension is a standard Manifest V3 web extension:
popup.html/popup.css/popup.js— the action popup shown when the toolbar icon is clicked. Runsurl-copy.jsto read the active tab URL and write it to the clipboard, displays "Copied URL", then closes after 1.2 seconds.url-copy.js— pure utility module (window.CopyUrlExtension). Tries the Clipboard API first; falls back todocument.execCommand('copy')if unavailable. No extension-specific dependencies; covered by unit tests.manifest.json— declaresactiveTabandclipboardWritepermissions. No background service worker. Keyboard shortcut:Command+Shift+C(Safari) orAlt+Shift+C(Chrome). Chrome reservesCmd/Ctrl+Shift+Cfor DevTools, so the manifest is patched at build time.scripts/build-chrome.mjs— Chrome build script. Copiesweb-extension/, patchesmanifest.json(generic description +Alt+Shift+Cshortcut), and zips todist/graburl-chrome-v<version>.zip. Never editdist/directly.
The GrabURL/ Xcode project wraps the web-extension/ files for Safari distribution. GrabURL/GrabURL Extension/Resources/ holds identical copies that must stay in sync with web-extension/.
web-extension/: source WebExtension files (popup, manifest, icons).tests/: Node tests for active-tab URL resolution and exact clipboard behavior.GrabURL/: generated Safari macOS wrapper project (Xcode build).web/: Astro landing page (deployed separately).scripts/: build automation (macOS signing, Chrome Web Store packaging, icon rendering, web deploy).dist/: Chrome build output (gitignored). Generated bypnpm build:chrome.docs/: design specs and project documentation.
- Edit extension source in
web-extension/— mirror changes identically toGrabURL/GrabURL Extension/Resources/. - Run
pnpm testbefore submitting changes. - To build the Chrome package, run
pnpm build:chrome. Never editdist/directly — it is regenerated on every build.