how to reverse the sort order of tabs in firefox?

2

1

I need to print (to PDF) a large number (about 80) of tabs all at once, but in a specific order. The problem is that the tabs all got opened in the reverse order of what I want. Dragging them around one at a time is just too painful to contemplate, so I'm looking for a way to just reverse the order of all currently opened tabs. I have them already saved to their own folder so I can easily reopen them, but need to reverse their ordering.

I found some old and outdated plugins that claimed to allow for this years ago, but nothing that looked like it would work in FireFox today. Any suggestions on where to look?

JVC

Posted 2014-03-08T23:36:09.523

Reputation: 309

Answers

3

Here is one way to reverse the sort order of Firefox tabs:

  1. Set Firefox's homepage to currently opened tabs by selecting Use Current Pages in Preferences > Home
  2. Copy the resulting string and paste it in new file, say, tabs.txt
  3. Insert newline at the end of tabs.txt

    $ echo >> tabs.txt
    
  4. Reverse the URLs order

    $ cat tabs.txt | tr '|' '\n' | tac | tr '\n' '|' > final.txt
    
  5. Copy the contents of final.txt and paste it in Custom URLs field in Preferences > Home

  6. Close all the currently opened tabs

  7. In a new fresh tab click on Home button and you're done!

rootkea

Posted 2014-03-08T23:36:09.523

Reputation: 131

1That’s a pretty clever and interesting solution… To be honest I moved on from this along time ago, and I don’t even remember what my eventual solution to what I needed became. But this seems like it probably would have done the job, although I’m not much for text manipulation from the command line personally. If I ever find myself needing to do this again, I will definitely have to try this out. – JVC – 2018-08-21T02:29:04.300

1

Based on @rootkea answer above, but slightly different. His answer won't work in windows since windows doesn't have cat command (I cannot write a comment so I chose write a complete answer). Reversing those urls can be done inside a browser with javascript.

  1. Go to FF console: press Ctrl + Shift + K or use context menu -> Inspect Element and select tab Console.
  2. Paste this code there and press enter (don't close console for now)

    let ta = document.body.appendChild(document.createElement('textarea'));

    Textarea appears stretched 100% horizontally at the bottom of the current page (if you do it right on this superuser's page). Textarea is needed for convenient work with special characters in a string with urls.

    It is possible to add some styling if you don't see the element. Enter this code to console

    ta.style.border = '4px solid red';

  3. Set Firefox's homepage to currently opened tabs by selecting Use Current Pages in Preferences > Home

  4. Copy the resulting string and paste it to textarea element, created before
  5. Paste this code to console and press enter

    ta.value = ta.value.split('|').reverse().join('|');

  6. Copy new string from textarea and paste it in Custom URLs field in Preferences > Home

  7. Close all the currently opened tabs

  8. In a new fresh tab click on Home button and you're done!

Timur

Posted 2014-03-08T23:36:09.523

Reputation: 21

1

Maybe bookmarking all the tabs, and then reordering them in the bookmark folder. They should open in the order they are in the bookmark folder.

sww1235

Posted 2014-03-08T23:36:09.523

Reputation: 88

yeah the problem is there is no "reverse order" for bookmarks either. It's looking more and more like the only viable option is a manual reorder. =( – JVC – 2014-03-09T00:15:41.283

I was thinking it would easier to manually manipulate them in teh bookmark folder than as tabs – sww1235 – 2014-03-09T00:22:35.387

Interestingly, I've found the opposite to be true, since I don't seem able to drag & drop bookmarks to change their order, but I can drag tabs around as needed. The closest to a solution I've come so far is: 1) Go into the bookmark editing window and under the Sort menu, is Sort By Added... select that 2) Now that I'm close to the correct order, go and rearrange the tabs manually in the browser window, and 3) save all bookmarks to a new folder in case something happens and I lose the window. Quite manual but, it's working. – JVC – 2014-03-09T00:31:17.790