Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Increase Sessionstore Files or Backup times?

  • 2 个回答
  • 0 人有此问题
  • 25 次查看
  • 最后回复者为 cor-el

more options

Hey I've been having a few problems on the "power user" extreme side of day to day use. I've had a couple big crashes now on Firefox where my session doesn't restore and because I have hundreds of tabs open at any given time I always back them up manually from sessionstore in the folder system. The problem is the session store files always reflect my most recent session- the one that doesn't have anything in it. The older sessions like "previous" and "upgrade" are always weeks old.

Is there a way to save data more frequently into the session store backup folder, or to increase the number of recovery files available to reach back to older sessions? I'd like to count on a backup at least once a week that can't be overwritten by the current session loss.

Hey I've been having a few problems on the "power user" extreme side of day to day use. I've had a couple big crashes now on Firefox where my session doesn't restore and because I have hundreds of tabs open at any given time I always back them up manually from sessionstore in the folder system. The problem is the session store files always reflect my most recent session- the one that doesn't have anything in it. The older sessions like "previous" and "upgrade" are always weeks old. Is there a way to save data more frequently into the session store backup folder, or to increase the number of recovery files available to reach back to older sessions? I'd like to count on a backup at least once a week that can't be overwritten by the current session loss.

所有回复 (2)

more options

You can search the Add-ons website for a suitable extensions manager extension.

You can also use code in the Browser Console to save/restore the current session. Creating a backup this way includes PB mode tabs/windows.

To enable the command-line in the console:

See:

You can create a compressed sessionstore.jsonlz4 or not compressed sessionstore.json file with a timestamp.


/* Save Session data to .json or .jsonlz4 */
var ssj = SessionStore.getBrowserState();
if(ssj){
 async function writeFile(aFile,ssj){await IOUtils.writeUTF8(aFile,ssj,/lz4$/.test(aFile) ? {compress:true} : {compress:false});}

 function dts(d){return(d.getFullYear()+"-"+(d.getMonth()+1).toString().padStart(2,"0")+"-"+d.getDate().toString().padStart(2, "0")+"_"+d.toTimeString().replace(/:/g,"-").split(" ")[0])}

 var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
 fp.init(window, "Save Session", Ci.nsIFilePicker.modeSave);
 fp.appendFilter("JSON/LZ4 Files", "*.json*");
 fp.defaultString = "sessionstore-"+dts(new Date())+".jsonlz4";
 fp.open(aResult => {
  if (aResult == Ci.nsIFilePicker.returnOK || aResult == Ci.nsIFilePicker.returnReplace) {
   try {
    writeFile(fp.file.path, ssj);
    alert("Saved as:\n" + fp.file.path);
   } catch (err) {alert(err);}
  } else {alert("CANCELED");}
 });
}

/* Restore Session data from .json or .jsonlz4 */
async function readFile(aFile){
 var ssj = await IOUtils.readUTF8(aFile, /lz4$/.test(aFile) ? {decompress:true} : {decompress:false});
 SessionStore.setBrowserState(ssj);
}

var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
fp.init(window, "Open File - Load Session", Ci.nsIFilePicker.modeOpen);
fp.appendFilter("JSON/JSONLZ4", "*.*json*");
fp.open(aResult => {
 if (aResult == Ci.nsIFilePicker.returnOK) {
  try {
   readFile(fp.file.path);
   alert("Session Restored:\n" + fp.file.path);
  } catch (err) {alert(err);}
 } else {alert("CANCELED");}
});

由cor-el于修改

more options

You can look at this tool to inspect a compressed jsonlz4 sessionstore file. This tool works locally, no uploading done.