Is there way to sort tabs in Firefox? That is, given a set of tabs, press a button to sort a group of tabs (e.g., by url). It shouldn't be always sorted, only when the button is pressed. Also, it'd be helpful if a subset of tabs could be specified.
However, you might be interested in using the "Tab Groups" feature, which lets you organize your tabs, manually, into multiple groups between which you can switch. To use this feature, click the tab group button (four rectangles) at the far right of the tab bar (alternatively, hit command-shift-E on Mac or control-shift-E on Windows/Linux).
You can read more here.
There is the Sort Tabs add-on - not as powerful as what you described, but it's better than nothing. Allows to sort tabs by title, works very well for me.
There is a mention they added sort tabs submenu into Firefox 'triple bar' button in 2017, but I cannot find it in Firefox 78.0.1 64bit. Seems removed later.
Thought, I found a great opportunity to
Ctrl-click and Shift-click tabs like in file explorer, then either put them into bookmark folder in one swoop, move to separate browser window (very handy for current session - but dangerous in case of power blackout - browsers only restore session in the '1st' window; you loose the rest unless you have automatic session recovery addons installed, such as thegreatsuspender; which is also not fail-proof btw), or send to another device (if firefox sync is activated).