How to Extract and Copy Links in Chrome
What Chrome can do on its own, a bookmarklet you can read before you use it, and an honest look at when an extension is worth the permissions it asks for.
Chrome has no built-in "copy all links" command. There are three real ways to get the list, and they differ mainly in how much trust each one requires.
| Approach | Setup | Sees JS-built links | Trust required |
|---|---|---|---|
| Developer console | None | Yes | You read the snippet before running it |
| Bookmarklet | Once | Yes | Same — you install the code yourself |
| Extension | Install | Yes | Ongoing access to page content |
| [Web tool](/url-extractor-from-website/) | None | No | It fetches the public page; nothing runs in your browser |
1. The developer console
Fastest, and needs nothing installed. Press F12 (or Ctrl/Cmd + Shift + J), go to Console, and paste:
copy([...document.querySelectorAll('a[href]')].map(a => a.href).join('\n'))Every link on the page is now on your clipboard. The JavaScript guide has variations for anchor text, filtering by domain, and a CSV download.
Chrome may ask you to type allow pasting the first time. That warning exists because "paste this into the console" is a real scam — take it seriously, and only paste code short enough to read.
2. A bookmarklet
If you do this often, make it a bookmark. It is the console snippet with a javascript: prefix, and unlike an extension you can read exactly what it does.
javascript:(function(){var l=[...document.querySelectorAll('a[href]')].map(a=>a.href);var u=[...new Set(l)];var w=window.open('','_blank');w.document.title=u.length+' links';var p=w.document.createElement('pre');p.style.cssText='font:13px/1.5 monospace;padding:16px;white-space:pre-wrap;word-break:break-all';p.textContent=u.join('\n');w.document.body.appendChild(p);})();Uses textContent rather than innerHTML, so a page’s own markup can never be injected into the window this opens.
Installing it
- 1
Show the bookmarks bar
Ctrl/Cmd + Shift + B.
- 2
Add a bookmark
Right-click the bar → Add page…. Name it "Copy links".
- 3
Paste the code as the URL
Paste the whole
javascript:line above into the URL field and save. - 4
Use it
Click it on any page. A new window opens with the unique links, ready to select and copy.
3. Extensions
The Chrome Web Store has several link-extraction extensions. We are not going to name or rank them, because we have not audited them and an extension's behaviour can change with any update.
What we can offer is how to judge one.
A link extractor needs to read the current page when you click it. That is a narrow, reasonable permission. Chrome describes it as access "when you click the extension".
Be careful about anything broader. "Read and change all your data on all websites" means exactly that — every page, including your bank and your email, all the time. Some extensions legitimately need it; a link copier does not.
Before installing, check:
- The permissions on the install prompt, not the marketing copy.
- When it was last updated. An extension abandoned for years is a liability, because extensions get sold and updated by new owners.
- Whether the reviews describe the same product. A sudden change in tone often follows a change of ownership.
- Whether you need it at all. The bookmarklet above does the common case, in code you can read.
4. What Chrome does give you
Small but useful:
- Copy one link — right-click → Copy link address.
- Open several links at once — select text covering multiple links, right-click → Open all links.
- Find where a link goes — hover and read the status bar bottom-left.
- Save the page — Ctrl/Cmd + S with "Webpage, Complete", then open the saved
.htmlin the HTML tool. Note that this saves the rendered page, so it includes JavaScript-built links. - Reading list and bookmarks — for keeping links rather than extracting them.
Frequently asked questions
Why does Chrome ask me to type "allow pasting"?
Because pasting code into the console is a well-known attack: someone talks you through pasting a script that steals your session on a site where you are signed in. The prompt is deliberate friction. Only paste code you have read.
Does this work in Edge, Brave or Opera?
Yes — they are all Chromium-based, so the console and bookmarklets behave the same. Firefox and Safari also support both, though the developer-tools shortcuts differ.
Can I do this on my phone?
Mobile Chrome has no developer console and no bookmarklet support. Use the [website tool](/url-extractor-from-website/) with the page address instead — it works from any browser.
Which is better, an extension or the web tool?
They solve different problems. An extension sees the page as you see it, including anything built by JavaScript and anything behind a login — at the cost of standing permissions. The web tool fetches the public page from our server, needs no install and no permissions, and cannot see either of those things.