MozillaZine

How do you decompress search.json.mozlz4?

Discussion about official Mozilla Firefox builds
streetwolf

User avatar
 
Posts: 2360
Joined: August 21st, 2011, 8:07 am
Location: NJ (USA)

Post Posted September 10th, 2016, 4:15 pm

I tried LZ4.exe but it didn't recognize the file, possibly because it's called moslz4 and not lz4. Is there a way on Windows 10 to decompress this file?
Intel Core i9-9900K@5.16GHz | Gigabyte Z390 AORUS MASTER | Corsair 1000W PSU | Corsair H115i CPU Cooler | Corsair 32GB RAM | EVGA GTX 1080 Ti FTW3 11GB | BenQ PD3200U 32" 4K LCD | 4-512GB Samsung 970 PRO M.2 | 2TB Samsung 860 EVO | 480GB SanDisk USB Extreme900 | Windows 10 Pro | FIOS 1Gb

Alice0775

User avatar
 
Posts: 2706
Joined: October 26th, 2007, 11:25 pm
Location: OSAKA JPN

Post Posted September 10th, 2016, 4:34 pm

streetwolf wrote:I tried LZ4.exe but it didn't recognize the file, possibly because it's called moslz4 and not lz4. Is there a way on Windows 10 to decompress this file?


Execute the following code in Browser Console ( set devtools.chrome.enabled=true inabout:config )

search.json.mozlz4 -> search.json
Code: Select all
function decompress() {
  Task.spawn(function() {
    let cacheFilePath = OS.Path.join(OS.Constants.Path.profileDir, "search.json.mozlz4");
    let bytes = yield OS.File.read(cacheFilePath, {compression: "lz4"});
    let data = new TextDecoder().decode(bytes);
    let jsonFilePath = OS.Path.join(OS.Constants.Path.profileDir, "search.json");
    OS.File.writeAtomic(jsonFilePath, data);
  });
}
decompress();


search.json -> search.json.mozlz4_new
Code: Select all
function compress() {
  Task.spawn(function() {
    let jsonFilePath = OS.Path.join(OS.Constants.Path.profileDir, "search.json");
    let bytes = yield OS.File.read(jsonFilePath);
    let data = new TextDecoder().decode(bytes);
    let cacheFilePath = OS.Path.join(OS.Constants.Path.profileDir, "search.json.mozlz4_new");
    OS.File.writeAtomic(cacheFilePath, data, {compression: "lz4"});
  });
}
compress();

streetwolf

User avatar
 
Posts: 2360
Joined: August 21st, 2011, 8:07 am
Location: NJ (USA)

Post Posted September 10th, 2016, 5:12 pm

thanks Alice.
Intel Core i9-9900K@5.16GHz | Gigabyte Z390 AORUS MASTER | Corsair 1000W PSU | Corsair H115i CPU Cooler | Corsair 32GB RAM | EVGA GTX 1080 Ti FTW3 11GB | BenQ PD3200U 32" 4K LCD | 4-512GB Samsung 970 PRO M.2 | 2TB Samsung 860 EVO | 480GB SanDisk USB Extreme900 | Windows 10 Pro | FIOS 1Gb

Pgr

User avatar
 
Posts: 233
Joined: October 28th, 2003, 10:00 am
Location: Lisbon, Portugal

Post Posted December 20th, 2018, 8:41 am

@Alice0775

I tried your function on my Firefox 64, in the Developer Console, and I got the following error:

Code: Select all
yield expression is only valid in generators


Do you know what this means and, more importantly, how to work around it?

Thanks a lot, I'd really like to get this working. :D

Fanolian
 
Posts: 856
Joined: February 21st, 2011, 10:14 am

Post Posted December 20th, 2018, 8:48 am


morat
 
Posts: 3191
Joined: February 3rd, 2009, 6:29 pm

Post Posted December 20th, 2018, 9:49 am


Brummelchen
 
Posts: 4265
Joined: March 19th, 2005, 10:51 am

Post Posted December 20th, 2018, 12:13 pm

jep, i have b'Ämarked jefferson his site :thumbsup:
users using outdated and vulnerable software probably never will get an answer from me - sticked with the past? stay alone.

therube

User avatar
 
Posts: 19681
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Post Posted December 20th, 2018, 2:20 pm

(For Windows users) dejsonlz4.v1.1 should work.

Code: Select all
Usage: dejsonlz4 [-h] IN_FILE [OUT_FILE]
   -h  Display this help and exit.
Decompress Mozilla bookmarks backup file IN_FILE to OUT_FILE.
If OUT_FILE is '-' or missing, decompress to standard output.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript

Return to Firefox Builds


Who is online

Users browsing this forum: No registered users and 2 guests