MozillaZine

How do you decompress search.json.mozlz4?

Discussion about official Mozilla Firefox builds
streetwolf

User avatar
 
Posts: 2264
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 i7-8700K@5.15GHz | Gigabyte Z370 AORUS Gaming 7 | Corsair 1000W PSU | Corsair H115i CPU Cooler | Corsair 32GB RAM | EVGA GeForce GTX 1080 Ti FTW3 11GB | BenQ PD3200U 32" 4K LCD | 2-512GB Samsung 970 PRO M.2 | 4TB WD Black | 480GB SanDisk USB Extreme900 | Windows 10 Pro | FIOS 1Gb

Alice0775

User avatar
 
Posts: 2659
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: 2264
Joined: August 21st, 2011, 8:07 am
Location: NJ (USA)

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

thanks Alice.
Intel Core i7-8700K@5.15GHz | Gigabyte Z370 AORUS Gaming 7 | Corsair 1000W PSU | Corsair H115i CPU Cooler | Corsair 32GB RAM | EVGA GeForce GTX 1080 Ti FTW3 11GB | BenQ PD3200U 32" 4K LCD | 2-512GB Samsung 970 PRO M.2 | 4TB WD Black | 480GB SanDisk USB Extreme900 | Windows 10 Pro | FIOS 1Gb

Return to Firefox Builds


Who is online

Users browsing this forum: No registered users and 2 guests