119

If I have a Firefox window open that contains 10 tabs, is there a way in Firefox or by a plug-in to get the URLs of those 10 tabs as a text file or some other format?

Right now if I want to do this I need to copy the URL of tab A, paste it somewhere, move to tab B, and repeat. I could also bookmark all the tabs into a folder and export that, but that seems like such a hassle.

If there is no such method, could someone point me to some documents that describe the basics of writing a Firefox plug-in. I am willing to write this myself if there is no "standard" way.

Hennes
  • 65,804
  • 7
  • 115
  • 169
hekevintran
  • 2,805

24 Answers24

90

Go to Tools > Options.

In the General tab look for the Use Current Pages button in the Startup section. When you click on the Use Current Pages button, all the URLs of the pages open in different tabs are copied to the Home Page text box with a pipe delimiter. Copy the text to get all the URLs.

The keyboard shortcut to simulate clicking on the Use Current Pages button is Alt+T+O+C (tested in Firefox 14)

mvark
  • 2,430
29

I found an add-on called Send Tab URLs that copies the URLs of all open tabs with the intention of sending them by email to someone. This add-on also allows the target of the URLs to be the clipboard as well as email so this solves my problem 100%.

https://addons.mozilla.org/en-US/firefox/addon/4437 (The add-on is no longer available)

kanlukasz
  • 462
hekevintran
  • 2,805
28

No need to export anything.

Just save all the tabs in a folder (you already know how to do that), right click on folder, copy. Open notepad, paste. Voila. All URL's of bookmarks in that folder.

Rook
  • 24,289
16

From the comment by @Rook:

  • Right click on any tab

  • Choose "bookmark all tabs"

  • Right click on the new folder

  • Choose "copy"

Now the URLs are in clipboard.

9

An open source plugin to do the job: Copy as Markdown. Added benefits: works on both Firefox and Chrome, and it exports with Markdown formatting.

Copy as Markdown for Chrome & Firefox

Do you often type Markdown code manually for a link or image, or even all tabs in a window, and feel tired? Copy as Markdown can help you!

Features

Copy as Markdown is a browser extension helps you copy the following things as Markdown to your system clipboard:

  • Current Tab as Link
  • A Link in the Page
  • An Image in the Page
  • An Image that is wrapped with a Link
  • All Tabs as a List of Links
  • Highlighted Tabs as a List of Links

Excerpt from the project's readme.

It can be added to Firefox from its Add-Ons listing.

gaborous
  • 2,102
7

The addon in the accepted answer is no longer available since the update to Firefox 57 in 2017.

Fortunately, there are many addons that provide the desired functionality of saving the URLs of open tabs to a text file. For example (in order of first release):

I wanted HTML output and timestamps, so I made my own:

(Disclaimer: I am the author of the last add-on.)

5
#Test in Firefox 5.0
$sessionStoreFile = "$env:APPDATA\Mozilla\Firefox\Profiles\*.default\sessionstore-backups\recovery.js"
$sessionStoreFileExists = Test-Path $sessionStoreFile
If($sessionStoreFileExists -eq $False) {
    #Test in Firefox 2.0, 3.0 and 4.0
    $sessionStoreFile = "$env:APPDATA\Mozilla\Firefox\Profiles\*.default\sessionstore.js"
}
(Get-Content -Encoding UTF8 -Raw -Path $sessionStoreFile).Trim('()') | ConvertFrom-Json |
Select -Expand Windows | Select -Expand Tabs | 
Where { !$_.hidden } | ForEach { @($_.Entries)[-1] } | 
Select Url, Title | Export-Csv -Path $CsvFile  -Encoding UTF8  -NoTypeInformation   

You can download detail SQL script from how to export all URLs of Firefox tabs at once(PowerShell)

5

Give a try to Export Tabs URLs (Firefox 48+)

It lets you either copy the current opened URLs list (optionally including their title) to clipboard or export it to a timestamped file.

alct
  • 51
4

This is not an addon, but for my own convenience I wrote a bash function if you are not afraid of the command line and if you are using Linux:

getOpenTabs(){
    local profile=$( sed -n -r '/^Path=/,/^Default=1/{ s|^Path=(.*)|\1|p; }' 
        "$HOME/.mozilla/firefox/profiles.ini" )
    # https://github.com/avih/dejsonlz4/blob/master/src/dejsonlz4.c
    dejsonlz4 "$HOME/.mozilla/firefox/$profile/sessionstore-backups/recovery.jsonlz4" |
        jq -c '.windows[].tabs[].entries[-1].url' |
        sed 's|^"||; s|"$||;' |
        xclip -selection c
}

On calling this function with getOpenTabs it reads the current session backup from the default profile folder extracts it using dejsonlz4, which you need to install for this function, and saves the links to the clipboard. Packages needed (besides dejsonlz4): jq, sed, xclip

mxmlnkn
  • 381
4

None of the present answers work for me (Firefox on Linux) and I didn't want to install an addon. This should work on all Operating Systems, I think.

  1. Right-click on a tab and click on Select all tabs
  2. Right-click on a tab and click on Bookmark tabs...
  3. Choose a name for the bookmark folder where you want to store them (e.g. My tabs)
  4. Press Alt to see the menu and choose Bookmarks-All bookmarks (Ctrl-Shift-O)
  5. Click on Import and Backup->Backup
  6. Choose where you want to back them up

When you want to restore in a new Firefox simply do step 4 and choose restore in step 5.

Calabacin
  • 141
4

Python code to extract URLs from recovery.jsonlz4 adapted from here and here:

import json
import lz4.block

Path to recovery.jsonlz4 on Windows is something like C:\Users{username}\AppData\Roaming\Mozilla\Firefox\Profiles{profile}\sessionstore-backups\recovery.jsonlz4.

with open(r'path/to/recovery.jsonlz4', 'rb') as f: f.read(8) # Skip magic number. compressed_binary_contents = f.read() binary_contents = lz4.block.decompress(compressed_binary_contents) contents = binary_contents.decode() data = json.loads(contents)

for window in data['windows']: for tab in window['tabs']: page_history = tab['entries'] url = page_history[-1]['url'] print(url) print()

mtanti
  • 141
3

I'm using Copy Urls Expert. It adds a menu item when I right-click on a tab. There are options to copy all URLs in the current window, in the current tab group, or all tabs; and also to open URLs from the clipboard. The URLs are just separated by newlines. I appreciated the simplicity of this approach, as compared to alternatives like Send Tab URLs which includes the title of each page along with the URL. "Copy Urls Expert" is a rewrite of CopyAllURLs, which is defunct.

3

You might want to consider a similar add-on with different options, CopyAllURLs; especially if mailing is not a priority. -Isn't that 2 clicks ? It's in the context menu. [That linked page also lists 'alternative solutions']

2

Exact steps described are for Linux, for Windows one might try to look at other answers in the link below (there are some e.g. using Python).

One can get tab URLs + titles list in text using https://superuser.com/a/1563665/1264656. Sample output:

"https://www.quora.com/Can-VR-headsets-emulate-having-a-large-monitor-for-your-laptop"
"Can VR headsets emulate having a large monitor for your laptop? - Quora"

"https://www.reddit.com/r/oculus/comments/9qet3j/can_you_use_a_vr_headset_as_a_monitor_for_games/" "(5) Can you use a VR headset as a "monitor" for games that do not have VR support and it will function as a display without headtracking? : oculus"

In case that link changes, I copy main part below:

lz4jsoncat ~/.mozilla/firefox/*default*/sessionstore-backups/recovery.jsonlz4 \
  | jq '.["windows"] | .[0] | .["tabs"] | .[] | .["entries"] | .[0] | .url,.title' \
  | grep -v 'New Tab' | grep -v 'about:newtab' | sed 's/"http/\n"http/g'

Relies on Firefox' "backup" in case of crashing, stored in recovery.jsonlz4 file in ~/.mozilla/firefox/profile_name/sessionstore-backups (that is in Linux, Windows is similar).

Files in sessionstore-backups can be used to transfer tabs from one PC to another (or backup). One need to abnormally terminate Firefox (not via build-in Quit) and replace contents of sessionstore-backups (4 small files on my PC) with such files backed up previously (or from another PC/profile), then Firefox starts with tabs from that folder.

Tested for Firefox 93 / 86 (yes, bringing files from newer to older too, whole profile from newer did not work on older).

To terminate Firefox in Linux:
pkill firefox& || pkill GeckoMain

2

The other answers work, but I figured out a way that doesn't make me want to tear my hair out (works as of Firefox 139 / May 2025).

  1. Enable the bookmarks toolbar (Ctrl+Shift+B to toggle)
  2. Right click on it → Add folder…Save
  3. Select the tabs you want to copy (click and Shift-click/Ctrl-click; or right click → Select All Tabs)
  4. Drag-and-drop the tabs onto your new folder
  5. Right-click the folder → Copy

Unlike the other answers, this doesn't require messing with the browser settings or other obscure dialogs, and can be cleaned up later with one step (right-click the folder → Delete Folder).

1

I recommend using https://github.com/balta2ar/brotab for this purpose:

pip install brotab
brotab install

Install the web extension as well: https://addons.mozilla.org/en-US/firefox/addon/brotab/

Restart Firefox, and you can pipe brotab list to a file:

brotab list > current-tabs.txt

You can also parse the output with e.g awk:

brotab list | awk -F'\t' '{
    print "Downloading "$2
    system("curl --silent --output \""$2"\" \""$3"\"")
}'
1

I happened to try dozens of Firefox addons that copy/export tabs URLs lately. Searching on Mozilla Firefox extensions catalog, at the moment I write, one of the most popular addon is
Export Tabs URLs and in fact it is not bad but, yet, digging a little bit more I think there are better alternatives, so now I'll suggest the ones I prefer.

First of all, a due premise: this makes sense only if you're dealing with lots of tabs, indeed, the addons I'm going to suggest do not distinguish current selected tab, they always take into account ALL the tabs you have opened in that moment in a Firefox window.

That said, here comes my favorite: Save Tab URLs.

This addon adds a new "Copy URLs (all tabs)" command into tab context menu and a tool button that makes a popup show up when clicked, the latter being the truly interesting stuff; indeed, once the popup is opened, you'll see a text-area, listing title and URLs of all the currently opened tabs, and commands that will let you filter listed entries, even using regex for it. Besides letting you copy to clipboard the text-area content (btw, you can also edit that if you want), you can as well save/export as a text file or it is possible for you to paste http(s) links in the text area and click on the provided command button to open them up back in new tabs (kinda as when you open all entries in a bookmarked folder). All of this is presented in pretty clean GUI. Both the tabs context menu and the popup commands always take into account all the tabs opened on the actual Firefox window (so no option for the single tab, as I said in the premise) and also keep in mind, btw, that this will be limited to current window only opened tabs (always including pinned ones) and if you have more than one Firefox windows opened, the tabs in others windows won't be taken into account. (I wish this one had some little more of improvements, like for example the option to copy only current tab URL/title via context menu, an option to copy only URLs without titles and adding at least Markdown -and maybe Json- format; with those features added this extension would be simply perfect for me!)

Highlight on Save Tab URLs Firefox addon

P.S. Save Tab URLs seems having a very similar alter ego (a kind of clone tbh) the only difference with it seems it lists tabs URLs only and no titles: URLs List. And, in case you're looking for an even minimalistic equivalent (just copy or open tab URLs): tabs2txt

Notable mentions:

  • Copy/Paste and Save tabs list It provide more or less the same features of the previous one thus it has a little messy GUI compared to it and it lacks text-area contents filtering and exporting to text file capabilities but kinda provide themes (lets you change color combination choosing beetween 2 dark ones and a light one) the option to add line-breaks between entries or not and to include or not titles with URLs. It also provide a kind of internal bookmarks system called "Saved lists".
  • Bulk URL Opener It has a nice GUI with dark/light theme, lets you save URLs lists in a similar fashion of the previous addon I talked about (I think the previous one has a better approach with that imho) but does not include tab titles in any way, just URLs.

Just like in the case of Save Tab URLs, both of them let you export the tabs list to a text file with few mouse clicks on some buttons but lack to provide other than titles+URLs and support no custom formats, if you need that you must use other Firefox addons such as Copy URL To Clipboard, CopyTabTitleUrl or Copy Selected Tabs to Clipboard (which imho are all better alternatives to the more popular Copy All Tab Urls) but they only let you copy to clipboard, so if you need to export the list to a file you'll have to create it by yourself and then paste the list in it and save it.

danicotra
  • 2,036
1

A good way to export all opened tabs from FIREFOX is "CTRL + SHIFT +D" or ALT + B and then Bookmark all tabs and save as folder bookmark in Bookmark Manager --> then export as HTML

1

I have used URL Lister for a couple of occasions. It is a simple addon that adds an option in "Tools". It then displays all open tabs' URL's in an editable text area.

It allows to export the list (by copying it to the clipboard) as plain text, HTML anchors or as a bulleted list.

It looks (by visual comparison of the available screenshots) similar to the beforementioned Send Tab URLs, with the differences being the lack of e-mail support and with the existence of the editable text area.

enter image description here

1

As the second choice you mentioned putting the links into a text file. That method allows you to create documentation for research, and to email the links with titles, and descriptions (or other meta data), creating your own choices of what you want to copy and how you want it formatted. You can use Multiple Tab Handler (Firefox addon). I will just show what I use for copying into email, as I think creating an unordered list of links with buried urls in hypertext would not show up well here. The first two pages did not have descriptions, so I threw in one of my own. If emailing I might manually boldface the titles, and remove the "::" when there is no description.

Tabbed Browsing in Firefox :: Tabbed browsing in Firefox lets you load multiple web pages into separate tabs within the same browser window

Using MTH works well for creating documentation in Evernote, useful if you work on multiple systems or want your notes available anywhere. To help you with some examples of setting up MTH with a variety of choices see http://dmcritchie.mvps.org/firefox/multiple_tab_handler.txt

0

For Firefox 57 (Quantum), the following Plugin seems to have similiar functionality to "Send Tab URLs" but honestly isnt as clean with the URL and Title:

https://addons.mozilla.org/en-us/firefox/addon/copy-as-markdown/

But it works. I hope the author of "Send Tab URLs" updates his plugin as WebExtensions.

semtex41
  • 1,025
-1

Use "Tab Groups" you can export/import all your tabs easily as a bookmarks

Martin
  • 1
-1

CLICK the "ICON" and drag to desktop. (The quickest way :) enter image description here

T.Todua
  • 4,053
-3

follow up to tazo's suggestion:

drag the "icon" (earth or lock or whatever) onto a Word doc. the URL appears at whatever point the cursor was left at.

this isn't a good solution for the original question, as you still have to go to each tab, but at least it's slightly faster than right-clicking in the address bar, copying, and then pasting in a document. it might also be a quick shortcut for those times when you just need to include the URL from a tab with some other text.

note: the first time i tried this, it appeared in the Word doc as different text. the text was a hyperlink, and when i opened to edit the hyperlink, the URL it pointed to was the tab i'd tried to drag over. i don't know where that text came from. my guess is it might have been the last bit of text i'd copied and it was sitting on the clipboard.

note2: this didn't work for Notepad.

note3: CopyAllURLs and URL Lister are not available for version 42.0 (or, as of sometime in 2014). Copy Links seems to still be an option. https://addons.mozilla.org/en-US/firefox/addon/copy-links/

colbey
  • 1