Export Synced Tabs in Firefox [closed]
Asked Answered
H

2

8

Is there anyway to export the list of synchronized tabs from a mobile device while viewing them in desktop Firefox? The tabs I want to save are found under Menu > Library > Synced Tabs. Right-clicking does not show any type of export functionality. My current thought would be to open all tabs and then Bookmark All Tabs but I have a lot of tabs so it will be slow to load all of the tabs.

Handsome answered 13/6, 2018 at 4:56 Comment(0)
E
10

Just building upon Thorsten K. answer (to whom I am grateful for hinting at the right direction), on your desktop install the addon About Sync.

This is the piece of software which exposes the info you want. It is not part of vanilla firefox, it is in an addon which was developed for developers.

From there follow Thorsten K.'s answer steps

  • open "about:sync" in a new tab, you should see the list "Collections"
  • scroll down to "tabs"
  • click on "Record Editor (server)"
  • in "Select record" select the record of the synced device of which you want want to export the tabs. If you have assigned client names to your devices, it's easy to identify them.
  • in the text box below, the list of all entries (one for each synced tab) is shown.
  • copy and paste this text into a text editor, and post-process it with text-search-and-replace as needed.

The content is in json format (it is not terribly complex even for non-developers) and the info you want should be in the fields "title" and "urlHistory".

Just beware that the latter is an array, which is to say it can store more than a single url. I am not sure what this exactly models (I suppose that, as each tab can be reused loading different urls, those urls are all shown in that field; however you cannot open that tab on the desktop and go forward and backward through such history). The only history entry that obviously matches the "title" is the first one.

In my case, "urlHistory" holds more than one url in just a handful of records, otherwise it is one single item, like in the two examples below:

[{
  "title": "GitHub - akahuku/wasavi: wasavi is an extension for Chrome, Firefox, and Opera. wasavi changes a textarea element to virtual vi editor which supports almost all the vi/ex commands.",
  "icon": null,
  "urlHistory": [
    "https://github.com/akahuku/wasavi",
    "https://github.com/Jermolene/TiddlyDesktop/issues/152",
    "https://www.google.com/search?q=edit%20tiddler%20in%20external%20editor&ie=utf-8&oe=utf-8&client=firefox-b"
  ],
  "lastUsed": "1548956216.29"
},
{
  "title": "[TW5] Markdown and katex plugins - Google Groups",
  "icon": null,
  "urlHistory": [
    "https://groups.google.com/forum/m/#!topic/tiddlywiki/PhFdqZ_eWLE"
  ],
  "lastUsed": "1550038099.58"
}]

If you process the text using a jsonpath processor (for example jsonquerytool.com) with the following expression

$[*].title

you get the list of titles

[
    "GitHub - akahuku/wasavi: wasavi is an extension for Chrome, Firefox, and Opera. wasavi changes a textarea element to virtual vi editor which supports almost all the vi/ex commands.",
    "[TW5] Markdown and katex plugins - Google Groups"
]

while with

$[*].urlHistory[0]

you obtain the first entry in the urlHistory for each tab.

[
    "https://github.com/akahuku/wasavi",
    "https://groups.google.com/forum/m/#!topic/tiddlywiki/PhFdqZ_eWLE"
]
Excursionist answered 8/7, 2021 at 23:56 Comment(6)
Using the tool jq (stedolan.github.io/jq) I can run jq '.tabs | .[] | {"title": .title, "url": .urlHistory[0]}' my-exported-tabs.json to get such an output: { "title": "Example title", "url": "https://example.com/ } Scholiast
And you can combine the JSON lines into a single array using e.g. jq -n '[inputs]'. I just used this on about 8500 tabs...Scholiast
This still works. I do the Copy&Paste, continue with the jq '.tabs | .[] | {"title": .title, "url": .urlHistory[0]}' my-exported-tabs.json and simplify it into a single array using js -n '[inputs]'. It just works! One minor thing, the extension only works after browser restart.Scholiast
Hm, I get "Hmm. That address doesn’t look right." when visiting about:sync (v 114)Armourer
@olejorgenb, you need to install the addon first: addons.mozilla.org/it/firefox/addon/about-syncExcursionist
Thanks (too shallow reading from me). Worked like a sharm. After I'd done it, I noticed that there now is a "share all tabs" option in the mobile app. Since I already had removed all my tabs (after the export) I didn't try it.Armourer
K
1

Here's a solution. Not nice, but it works (here on FF78.0.2 64 bit).

  1. open "about:sync" in a new tab, you should see the list "Collections"
  2. scroll down to "tabs"
  3. click on "Record Editor (server)"
  4. in "Select record" select the record of the synced device of which you want want to export the tabs. If you have assigned client names to your devices, it's easy to identify them.
  5. in the text box below, the list of all entries (one for each synced tab) is shown.
  6. copy and paste this text into a text editor, and post-process it with text-search-and-replace as needed.
  7. Voila!
Kristofer answered 18/7, 2020 at 10:34 Comment(1)
Dang, seems not to work as of FFv88.0.1. No about:sync, just about:sync-logHarlotry

© 2022 - 2024 — McMap. All rights reserved.