Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Increase Sessionstore Files or Backup times?

  • 2 replies
  • 0 have this problem
  • 25 views
  • Last reply by 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.

All Replies (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");}
});

Modified by cor-el

more options

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