Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Can't decompress recovered jsonlz4 session file

  • 3 답장
  • 1 이 문제를 만남
  • 1 보기
  • 최종 답변자: cor-el

more options

I recovered a deleted 'previous.jsonlz4' file from my SSD but FF (56.0.2) seems to ignore it completely and also tools like the "Session History Scrounger" or command line decompression tools like dejsonlz4.v1.1 or lz4_v1_8_1_win64 cannot decompress it. The file however seems to have the right size and that it has been recovered successfully. It is pretty big BTW with like 2,5 MB.

Is there a way to analyze the recovered file and to tell why it cannot be compressed?

I am using FF 56.0.2 with the TabGroup Add-on

I recovered a deleted 'previous.jsonlz4' file from my SSD but FF (56.0.2) seems to ignore it completely and also tools like the "Session History Scrounger" or command line decompression tools like dejsonlz4.v1.1 or lz4_v1_8_1_win64 cannot decompress it. The file however seems to have the right size and that it has been recovered successfully. It is pretty big BTW with like 2,5 MB. Is there a way to analyze the recovered file and to tell why it cannot be compressed? I am using FF 56.0.2 with the TabGroup Add-on

모든 댓글 (3)

more options

hi, you could try https://www.jeffersonscher.com/res/bookbackreader.html - despite its title it should also work for sessionrestore files.

more options

Thanks Philipp! There I get the following error: "failed JSON parsing: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data" and the text area stays blank. Kind regards

more options

If you recover (undelete) a file then it isn't guaranteed that the file isn't corrupted. Especially with bigger files and possibly fragmentation chances get lower and some clusters may have been reused.


You can use this code in the Browser Console to decompress a LZ4 file.


var {classes:Cc,interfaces:Ci,utils:Cu} = Components;
function decompressFile(oFilePath,nFilePath){
  Cu.import("resource://gre/modules/Task.jsm");
  Cu.import("resource://gre/modules/osfile.jsm");
  return Task.spawn(function* () {
    var jsonString = yield OS.File.read(oFilePath,{compression:"lz4"});
    yield OS.File.writeAtomic(nFilePath, jsonString);})
}
// Set up file chooser
var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
var fu = Cu.import("resource://gre/modules/FileUtils.jsm").FileUtils
fp.init(window, "Open File", Ci.nsIFilePicker.modeOpen);
fp.appendFilter("Bookmarks/Session (.jsonlz4)","*.jsonlz4");
fp.appendFilter("Search Engines (.mozlz4)","*.mozlz4");
fp.appendFilter("Add-ons Files (.lz4)","*.lz4");
fp.displayDirectory = fu.File(OS.Path.join(OS.Constants.Path.profileDir, "sessionstore-backups"));
// Call file chooser
fp.open((aResult) => {
  if (aResult == Ci.nsIFilePicker.returnOK) {
  if (fp.file.exists() && fp.file.isFile() && fp.file.isReadable()) {
    var oldfile = fp.file.path;
    var newfile = oldfile + ".json";
    try {
      decompressFile(oldfile, newfile);
      console.log("Saved as: \"" + newfile + "\"");
      if(confirm("Open JSON file in a Firefox tab?")){
        var uri="file:///"+newfile.replace(/\\/g, "/");
        window.open(uri, "_blank");
      }
    }
    catch (err) {console.log(err);}
  } else {console.log("<error>");}
  } else {console.log("<canceled>");}
});