проверить файл sessionstore.json на предмет восстановления несохраненного текстового поля

576
cnst

Когда происходит сбой SeaMonkey или Firefox, часть текста, который вы пишете в различных HTML-формах, должна быть восстановлена ​​через sessionstore.jsonваш профиль.

Проблема заключается в том, что восстанавливаемость зависит от того, могут ли быть запрошены те же самые страницы, и будут ли они содержать те же поля ввода для вашего текста, который будет помещен, в противном случае кажется, что он исчезнет навсегда.

Возможно, есть какой-то способ, (1), автоматически определить такой текст, подлежащий отбрасыванию, и восстановить его, или, по крайней мере, (2), сделать возможным изучение целого sessionstore.jsonи четкую идентификацию любого такого сохраненного текст (для ручного размещения в соответствующих текстовых полях (после аутентификации и т. д.)).

0

1 ответ на вопрос

1
pyrocrasty

I think the file is normally called sessionstore.js (although it only contains valid JSON).

If there is data you may want from the file, you should make a copy of the file to preserve it before restarting Firefox. (I'll assume you've called the copy sessionstore.bk.json).


Accessing the data from the terminal.

Note: This section focuses on Unix-like OSes (Linux, Mac, BSD). If you're on Windows, you can either use a Unix style terminal (eg. Git Bash, MSys, etc) or adapt the instructions to a Microsoft terminal. (For all I know, they might even work as is in Powershell; I'm not familar with it.)

You can pretty print the file to make it readable, and search and copy data using either your terminal pager or a tool such as a text editor. A couple of good command line tools:

  • Python's json module comes with the command line json.tool. For instance, on a Unix shell, the following command will save the file nicely formatted:

    cat sessionstore.bk.json | python -m json.tool > sessionstore.pretty.json 

    or the following command will let you read it in the terminal pager:

    cat sessionstore.bk.json | python -m json.tool | less 
  • Node.js's underscore-cli command line tool. If you install NPM, you can then install underscore-cli with the command

    npm install -g underscore-cli 

    Then you can pretty print in colour to the terminal pager with the command:

    cat sessionstore.bk.json | underscore print --outfmt pretty | less 

Accessing the data with Python.

If you have a basic familiarity with Python, you can import the data into Python as a dict and access it using the standard methods. For example:

import json f = open("sessionstore.bk.json") data=json.load(f) # print a list of top-level JSON entries for key in data: print key 

Most other languages should have similar libraries available for importing JSON data.


Accessing the data with a dedicated JSON viewer.

You could also use a JSON viewer application. A couple of possibilities:

хорошо, спасибо! да, мой файл вырастает до нескольких мегабайт, поэтому сложно разобрать его все без красивой печати. cnst 8 лет назад 1