3

I need to decompress firefox 57+ opened tabs file.

I use unlz4 from the Ubuntu package liblz4-tool :

$ cp .mozilla/firefox/t6bznle5.default/sessionstore-backups/recovery.jsonlz4 ~/recovery.lz4
$ unlz4 recovery.lz4
Decoding file recovery
Error 44 : Unrecognized header : file cannot be decoded
$ echo $?
44
Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
SebMa
  • 1,941
  • 4
  • 22
  • 37
  • 4
    Long story short: jsonlz4 is not quite lz4. [This](https://github.com/avih/dejsonlz4) decompressor should help you extract the file contents. – undercat Aug 28 '18 at 15:26

1 Answers1

3

I tested the following methods to be working, on Ubuntu 20.04:

Method 1: Using the mozlz4 binary from GitHub:

Download the linux binary for mozlz4 from https://github.com/jusw85/mozlz4. Then run the following:

chmod u+x mozlz4-linux

./mozlz4-linux -x filename.jsonlz4

Method 2: Using the lz4json package from Ubuntu repos:

Ubuntu 20.04 repos have a package named lz4json. I haven't checked whether it is present on previous Ubuntu versions.

To install and use that, run

sudo apt install lz4 lz4json

lz4jsoncat ~/.mozilla/firefox/*default*/sessionstore-backups/recovery.jsonlz4

The above output will show a minified json. To make it readable, you can use the 'jq' json parser:

sudo apt install jq

# then pipe the output of the previous command through jq to make it readable:
lz4jsoncat ~/.mozilla/firefox/*default*/sessionstore-backups/recovery.jsonlz4 | jq

If you just want to see the list of URLs and the page titles, you can use this:

lz4jsoncat ~/.mozilla/firefox/*default*/sessionstore-backups/recovery.jsonlz4 \
  | jq '.["windows"] | .[0] | .["tabs"] | .[] | .["entries"] | .[0] | .url,.title' \
  | grep -v 'New Tab' | grep -v 'about:newtab' | sed 's/"http/\n"http/g'
Anto Jose
  • 31
  • 2