Is there a method to export the URLs of the open tabs of a Firefox window?

82

28

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.

hekevintran

Posted 2010-01-17T01:53:15.623

Reputation: 2 211

Answers

25

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

hekevintran

Posted 2010-01-17T01:53:15.623

Reputation: 2 211

4unfortunately this is end of life with Firefox 57. Has anyone found an alternative? – semtex41 – 2017-10-12T23:03:23.657

1

@semtex41 Yes there is. Here it is: https://addons.mozilla.org/en-US/firefox/addon/copy-all-tab-urls-we/ Its called "Copy All Tab URLs WE"

– Abhishek Oza – 2017-11-16T10:40:33.340

1

Also, another: https://addons.mozilla.org/en-US/firefox/addon/export-tabs-urls-and-titles/?src=search

– MarsAndBack – 2018-08-28T14:43:58.813

fwiw the code is available at https://github.com/aecreations/sendtaburls/ (or at SWH)

– myrdd – 2018-10-31T14:13:52.007

78

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

Posted 2010-01-17T01:53:15.623

Reputation: 2 260

2For Mac users, go to Firefox > Preferences (the Tools menu has no entry Options). – Jim DeLaHunt – 2014-09-28T00:07:21.897

1This only includes tabs in the current tab group. – Tanath – 2015-06-26T06:46:43.793

3This method works wonderfully, but you'll have to do it for each window. It also doesn't grab pinned tabs, so you'll have to do those separately as well. – Tustin2121 – 2015-09-04T16:04:36.193

1@Tanath This only includes tabs in the current tab group Thankfully. Otherwise it would mix all groups together. – Calculus Knight – 2016-09-17T10:59:23.533

While Firefox doesn't handle a drag and drop of this string directly into the browser, it does handle a drag and drop of the URLs with a newline separator. sed "s/|/\n/g" – palswim – 2018-04-13T21:53:18.860

3This shouldn't be the answer. Let me get this straight, you are temporarily setting your homepage to a string containing current tabs separated by pipes (which won't look very nice when psting into an email or doc). You copy the URL, and then undo to set your homepage back to how you had it. What happens if you forget that step? Rook's answer is a much a better logical method to get all tab URLs. – MarsAndBack – 2018-08-28T14:53:08.570

10This action can also be easily reversed, just hit ctrl-z to undo the change and whatever was in the textbox previously will be restored. Now you don't have to install a plugin. – kurtzbot – 2013-06-17T22:38:45.090

3This is not working for me when trying to save a huge session of 300+ tabs in about 7 Windows. There seems to be a limit to this trick in terms of tab numbers, beware – None – 2014-02-18T12:31:41.597

2T.O.C. = Table of Contents! Neat! Works in Firefox 17.0.9 on Windows. – isomorphismes – 2014-03-03T12:46:33.643

3Nice answer. Alt+E+N+C for any other Linux users. :) – Ash – 2014-05-17T02:51:44.003

11

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

Posted 2010-01-17T01:53:15.623

Reputation: 21 622

2This is not so unusal a problem. I was looking for the very same thing. I have 50+ tabs openon my work pc from things I find in my lunch break I either want to remember or come back and read in depth later. i want to export and store so I can open at home and browse at leisure. +1 for question – ianfuture – 2010-03-12T12:42:20.280

This was very quick. The steps are CTRL-SHIFT-D to bookmark all tabs -> right click on new bookmark group -> Copy -> Paste into email. Very nicely it pastes as text with the url as a link so you know what each url actually is. – fantabolous – 2015-08-08T01:58:08.427

@ianfuture .- Sorry, for the fantastically late reply, but do you know of https://pinboard.in/ ? It's a very nice bookmark system which you can access from both work and home. Costs like a few dollars at the beginning, and then - that's it. Just for info.

– Rook – 2019-10-07T17:42:50.403

1Yes, that does work, but I was thinking more along the lines of having an option in a plug-in menu or the context menu that would put the URLs into my clipboard. Then I won't have to create, view, and delete intermediate bookmark folders. – hekevintran – 2010-01-17T02:36:36.150

Sorry, don't know of any plugin which would do that. It is a rather unusual request (I still can't see why do you need something like that...). Anyways, you got one way now ... this one takes about 6 clicks ... the fastest I know, sorry. – Rook – 2010-01-17T02:53:03.287

Right click on tab, bookmark all tabs, ok, right click on dir, copy ... url's are in clipboard ... 5 clicks. – Rook – 2010-01-17T02:53:49.480

Yeah you are right about it's unusualness. I think I'm going to look up references on writing Firefox plug-ins. I want it to be 2 clicks dammit! Thanks though. – hekevintran – 2010-01-17T02:59:12.323

This may help you :: http://stackoverflow.com/questions/24772/how-do-i-write-a-firefox-addon | You still haven't told what do you need something like that for ? ;)

– Rook – 2010-01-17T03:16:13.017

5

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

Posted 2010-01-17T01:53:15.623

Reputation: 1 412

Thanks. I had written my own bookmarklet to do this for the current tab but this extension provides more useful features. – Anthony Geoghegan – 2019-03-20T15:23:34.797

4

#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)

frank tan

Posted 2010-01-17T01:53:15.623

Reputation: 41

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.

Metamorphic

Posted 2010-01-17T01:53:15.623

Reputation: 325

1I'm also a fan of this, but Firefox Quantum ... reeee. Copy Urls Expert is one of the reasons I didn't update, yet. With the script in my answer that is solved for me, but I also need a replacement for Menu Wizard and Tab Mix Plus. – mxmlnkn – 2018-02-24T13:48:46.080

@mxmlnkn Yeah I just downgraded by installing a Firefox ESR binary. So I can type in this box with "It's All Text!". – Metamorphic – 2018-02-25T04:41:48.780

3

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

Posted 2010-01-17T01:53:15.623

Reputation: 31

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']

allanrockwell

Posted 2010-01-17T01:53:15.623

Reputation: 334

you can download the latest version from the homepage.

– DJCrashdummy – 2015-11-18T08:02:31.727

2@DJCrashdummy that is generally a bad idea.... addons on the site get checked for stability, malware etc – Wilf – 2016-01-25T01:41:47.453

2Sheesh, this add-on is now out of date.....what solution will even work for this problem? – None – 2014-02-18T12:34:01.030

2

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.

aparente001

Posted 2010-01-17T01:53:15.623

Reputation: 362

Some notes & hints: (1) When you choose ”bookmark all tabs“, Firefox will open a new window asking you to define the name and the location of the folder to be created. (2) The URLs in the clipboard will be separated by newlines. The first line will contains the previously defined folder name. (3) about ”right-clicking on the new folder“: You can right-click not only in the ”Library“ (Ctrl+Shift+O), but also in the Bookmarks Toolbar (given you created it there), the Bookmarks Sidebar (Ctrl+B) or even the drop-down menu of the menu bar. – myrdd – 2018-10-31T15:11:18.740

@ aparente001: PS: I suppose you are referring to this comment by Rook. PPS: you've got a typo in ”Chooseookmark“ ;)

– myrdd – 2018-10-31T15:14:10.643

1Press CTRL+SHIFT+D in Firefox (Windows) if the option "Bookmark all tabs" is not there when you right click a tab. – Leopoldo Sanczyk – 2019-09-05T18:55:57.613

1

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

Posted 2010-01-17T01:53:15.623

Reputation: 151

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"\"")
}'

Doron Behar

Posted 2010-01-17T01:53:15.623

Reputation: 181

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

Doktoro Reichard

Posted 2010-01-17T01:53:15.623

Reputation: 4 896

1In contrast to Send Tab Urls, URL Lister doesn't work with Firefox 56. – maxschlepzig – 2017-11-30T09:51:25.167

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

dmcritchie

Posted 2010-01-17T01:53:15.623

Reputation: 11

I object to edit done to the above, which is well intended, but destroys the content. MTH does not generate rich text format, so it cannot generate what is shown above. For something similar to the above one would have to use a different set of output and put that output through an online editor before pasting into an email. The example included a link to this very question so that one can see specifically what might be generated, plus two more links (still included) that not only serve to show in the example but as links to additional content of interest. Severe limitations on answers. – dmcritchie – 2015-11-19T18:02:54.723

Answer is supposed to include @djcrashdummy, -at-Hennes, and -at-duDE. At the time I did not have enough points to post nice links which would only have applied to the first list for Multiple Tab Handler within the large paragraph. And now I lack (a few thousand) points to be able to reverse an incorrect edit. – dmcritchie – 2015-11-19T18:15:06.940

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

Posted 2010-01-17T01:53:15.623

Reputation: 945

You can use this: https://addons.mozilla.org/en-US/firefox/addon/copy-all-tab-urls-we/

– Abhishek Oza – 2017-11-16T10:42:08.990

0

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.)

Nathaniel M. Beaver

Posted 2010-01-17T01:53:15.623

Reputation: 312

0

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

Petre Sosa

Posted 2010-01-17T01:53:15.623

Reputation: 101

Bookmark all tabs??? What about the existing bookmarks? – Peter Mortensen – 2017-09-25T17:43:46.993

-1

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

Martin

Posted 2010-01-17T01:53:15.623

Reputation: 1

2While this may answer the question, it would be a better answer if you could provide some explanation why it does so. For example, a brief explanation of what tab groups are, and how to export them. – DavidPostill – 2017-04-07T08:03:09.517

-1

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

T.Todua

Posted 2010-01-17T01:53:15.623

Reputation: 2 436

-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

Posted 2010-01-17T01:53:15.623

Reputation: 1