Firefox Tabs
Count Tabs
Right-click on any tab
Select All Tabs
Right-click on any tab
You will see an option to "close x tabs" where x is the number of tabs open in your Firefox window.
Repeat for other Firefox windows
Recover Tabs
When your History won't let you open the correct "Recently Closed Tabs" or "Recently Closed Windows"...
First find out which directory we should be working in... type this is the Firefox address bar...
about:support
You should see an entry titled Profile Directory
The entry will be Profile Folder on WindowsClose Firefox from the menu (not just by closing the Window)...
Using Quit from the menu does a full shutdown of Firefox, just closing the last open window does not.There should now be a file called sessionstore.jsonlz4 in the Profile Directory you found above.
If the file doesn't exist, it usually means you have failed to close Firefox properly.Look in sessionstore-backups for a file containing the tabs you want to restore and copy it to the Profile Directory. Use the scrounger.html link to see the contents of the files.
To be safe (in the Profile Directory)...
mv sessionstore.jsonlz4 sessionstore.jsonlz4OLD
mv sessionCheckpoints.json sessionCheckpoints.jsonOLD
mv sessionstore-backups sessionstore-backupsOLD
Rename the file you copied in from sessionstore-backups to sessionstore.jsonlz4.
Start Firefox.
Your missing tabs and windows should have returned (see History to reopen windows)- previous.jsonlz4 (cleanBackup: copy of sessionstore.jsonlz4 from previous session that was loaded successfully)
- recovery.jsonlz4 (latest version of sessionstore.jsonlz4 written during runtime)
- recovery.baklz4 (previous version of sessionstore.jsonlz4 written during runtime)
- upgrade.jsonlz4-<build_id> (backup created during an upgrade of Firefox)
Bibliography
Count Tabshttps://superuser.com/questions/1789739/get-the-number-of-open-tabs-in-firefox