Join the Mozilla’s Test Days event from 9–15 Jan to test the new Firefox address bar on Firefox Beta 135 and get a chance to win Mozilla swag vouchers! 🎁

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

Increase Sessionstore Files or Backup times?

  • 2 trả lời
  • 0 gặp vấn đề này
  • 8 lượt xem
  • Trả lời mới nhất được viết bởi 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.

Tất cả các câu trả lời (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");}
});

Được chỉnh sửa bởi cor-el vào

more options

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