2

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?

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

  3. Run this command (Here string is the copied string):

    $ echo 'string' | tr '|' '\n' | tac | tr '\n' '|' | sed 's/.$/\n/'
    
  4. Copy the string generated by above command and paste it in Custom URLs field in Preferences > Home

  5. Close all the currently opened tabs

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

1
  • 1
    That’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 Aug 21 '18 at 2:29
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.

3
  • 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 Mar 9 '14 at 0:15
  • I was thinking it would easier to manually manipulate them in teh bookmark folder than as tabs – sww1235 Mar 9 '14 at 0:22
  • 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 Mar 9 '14 at 0:31
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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.