I am guilty beeing a tab messy and was searching for a while for a good solution to move my open tabs to OneTab. Especially on mobile the tab situation was extremely bad. When I realized that I had over 3000 (!!) tabs on my iPhone opened I acknowledge that I got to do something.
First I tried to just open the tabs in Firefox. When you rightclick a device on the "Synced Tabs" sidebar there is an "Open all tabs" entry.
For 3000 tabs already my computer was already overloaded when opening them… Closing every other open program and removing every browser extension other then blockers also didn't do the trick.
After some time the tabs seemed to be in an open state, but Firefox was not really responding. I tried closing the tabs via OneTab and also to save them all as bookmark via Bookmarks -> Bookmark all Tabs
but that also didn't work.
So I played around with various accessible API implementations. After a few hours I almost gave up. The libraries that I found were either that old that installing was really complex (old dependencies) or I couldn't get past the authorization.
So that's how I ended up getting the data that I wanted by using this ugly trick:
-
Download and install "About Sync" Firefox extension https://addons.mozilla.org/en-US/firefox/addon/about-sync/ This extension is made for debugging the Firefox Sync.
-
Navigate in Firefox to
about:sync
(Since this is not a valid URL, a markdown link is not possible) -
Go to the Firefox Debugger and add
response
under Watch Expressions and add a breakpoint to thefetchCollection
function in the line where theresponse
variable gets declared. -
Click the "Refresh" button on the page
-
Resume through breakpoints until
response.url
is the tab endpoint of the api. Will be something likehttps://sync-1-us-west1-g.sync.services.mozilla.com/1.5/143199178/storage/tabs?full=1&limit=1000
-
The expression variable is now declared in the console. Go there.
You can inspect the data with:
console.log(response)
Copy the urls of the tabs to the clipboard in a format that is understandable by the OneTab import:
// this is the index of the record (aka synced device)
const SYNCED_DEVICE_INDEX = 1;
const { tabs } = response.records[SYNCED_DEVICE_INDEX].cleartext
// format to OneTab CSV
const oneTabEntries = tabs
.map(({ urlHistory, title, lastUsed }) => {
return urlHistory[0] + ' | ' + title + ', ' + lastUsed
})
.join(('\n'))
// copy to clipboard
copy(oneTabEntries)
Here is probably an even simpler guide: https://stackoverflow.com/questions/50829318/export-synced-tabs-in-firefox it uses About Sync too (beware, after installing, you have to restart the browser).