The Autodidacts

Exploring the universe from the inside out

How to copy URLs of multiple Firefox tabs without installing an extension

It’s easy, once you know you can

Once upon a time, I ran across an experimental project called TabFS, which mounts browser tabs as a filesystem. This seemed like such a cool idea! Ever since, I have wanted a way to interact with tabs programmatically. But the main thing I’ve wanted to do is be able to grab the URLs of some or all of my open tabs, and paste them into a text file.

Each time I have looked into this before, it hasn’t been possible without installing an extension. And I don’t like installing extensions.

I often have text files of URLs, one per line, related to some project. Often I want to be able to open them all in Firefox (easy in Helix editor with %s\n<ret>xgf [1]) while I’m working on the project, close ones that aren’t relevant any longer and follow new leads, and then save the updated list when I’m done, without interacting with bookmarks (my graveyard for URLs that are “interesting” and “relevant” and I’m definitely never going to visit again).

Another common use-case is when I want to copy the URLs for a group of tabs and pass them to a script (in this case, my Ghost API markdown export script).

Today, I discovered that it’s not just possible, it’s easy! It looks like this feature was added in v152.0a1, 4 months ago.

  1. Select some tabs (right click on a tab, then click “Select all tabs”; or click on one tab, then shift click on another to select range, or ctrl click to cherry-pick individual tabs)
  2. Right click on tab, or open File menu
  3. Click “Share”
  4. Click “Copy n links”

Watch:

0:17
/0:19

You can do steps 2-4 in one go by pressing (in sequence) Alt f h l

I want to be able to do everything with the keyboard. However, although you can cycle through tabs and move tabs with keybindings, weirdly, there doesn’t seem to be a Firefox keybinding for selecting tabs, or for opening the tab right click menu (Shift+F10 opens the page right click menu, even if tabs are selected and the mouse is hovering over a tab).

If you paste these tabs into a rich text field, they will be links with titles, but if you paste them into a plaintext editor, they will be plain URLs, one per line!


  1. % select buffer, s open split dialog, \n split delimiter, <ret>/Enter split selection on delimiter, x extend selections to whole line, gf (g)oto (f)ile, which opens URLs in the browser ↩︎

Reply by email Buy me a coffee.

Get new posts by email:

Great! Check your inbox and click the link to confirm your subscription.

Hmm, that didn't work. Please try again, and if it still doesn't work, get in touch.


Curiositry’s profile image

Curiositry

I write and build things.  Canada’s wet west coast  https://curiositry.com



Sign up for updates

Join the newsletter for curious and thoughtful people.
No Thanks

Great! Check your inbox and click the link to confirm your subscription.