Jsonlz4 конвертировать файл резервной копии в формат экспорта html
Я пытаюсь разобраться в собственном формате файлов Mozilla Firefox, который .jsonlz4 используется, например, для sessionstore-backups/recovery.jsonlz4 , но безрезультатно.
Как мне вернуть мои данные, в частности, какой-нибудь длинный текст, который я набрал в некоторых текстовых областях сбойного сеанса? Это мои данные!
Я бы не назвал этот формат закрытым . Конечно, это пользовательский, не используемый где-либо за пределами проектов Mozilla, но, поскольку весь Firefox, включая соответствующий (де) код сжатия, является бесплатным и открытым исходным кодом, этот формат не следует называть проприетарным. (PS Я не говорю о брендинге, который лицензируется по-разному.)
@Ruslan, но на самом деле он проприетарный - только потому, что OSS не делает его непатентованным, поскольку существуют нулевые стандартные инструменты для просмотра содержимого этих файлов, тогда как все остальные файлы, даже формат JAR Java, могут легко управляться с помощью 100% стандартных непатентованных инструментов, которые доступны в портах / пакетах каждой приличной системы UNIX. ОТО, совершенно нетривиально на самом деле получить ваши собственные данные из этих .jsonlz4 файлов.
откройте Scratchpad из Firefox:
- либо с fn + Shift + F4 на MacBook,
- или Shift + F4 ,
- или через строку меню через Сервис → Веб-разработчик → Скретчпад
в строке меню в Scratchpad Firefox измените Среду с Контента на Браузер (если пропустить этот шаг, это приведет к ошибкам, как Exception: ReferenceError: OS is not defined на следующем этапе)
используйте код вроде следующего в Scratchpad Firefox:
Последний параметр для JSON.stringify обработки количества пробелов в каждой строке; установка 0 приводит к тому, что все это печатается в одну строку, а установка 1 правильно разделяет строки (установка 2 создаст слишком много бесполезных пробелов и увеличит размер файла для небольшой выгоды)
нажмите Run кнопку
запустить fgrep :textarea /Users/…/sessionstore-backups/recovery.baklz4.uncompressed.stringify из приложения терминала
Это не работает в FF 72 в Linux. Блокнот был удален, но консоль теперь поддерживает многострочный режим. Тем не менее, OS.File.read(. строка дает: «ReferenceError: ОС не определена».
@mivk эта ошибка упоминается выше - происходит из-за неправильной среды; нет ли возможности подвергнуть риску окружающую среду?
Firefox creates frequent backups of your bookmarks. Automatic backups are compressed using Mozilla's flavor of LZ4 compression (.jsonlz4 file extension), while backups you create yourself (in the Library window) are not compressed (.json file extension by default). This tool can convert a backup file to the HTML export format.
Step 1: Load File
Drag and drop one .jsonlz4 (or .json) bookmark backup file onto the empty text box, or use the Browse. button on the right. ( HELP ) These files are stored in the bookmarkbackups folder in your Firefox profile folder. If you are unfamiliar with how to locate your profile folder, please see: Profiles - Where Firefox stores your bookmarks, passwords and other user data on Mozilla Support. This file is not sent to the network, it is only read within this page in Firefox. Performance Note: Decompressing files and working with large sets of bookmarks is processor intensive, so please be patient. If the fan won't stop running or results take longer than 15 seconds, you can close the tab and launch the document again.
Note: To try a different file, reload this page (Windows: Ctrl+r. Mac: Command+r). Or click the reload button in the address bar.
Step 2: Convert / Repair / Save Your Bookmarks
HTML "Export" Format: Add indenting (for easier reading) Show Folder Path Export HTML
Preserve separators Make Tags visible Make Keywords visible Show Date Added
Older backups: Include Descriptions Only Bookmarks with Descriptions ( Bookmark Notes importable)
Currently does not embed icon data.
JSON "Backup" Format: Clear Descriptions Save JSON
Check/Repair JSON For files Firefox cannot restore
Extract Tagged Bookmark List: Get Tags
Extract Keyworded Bookmark List: Find Keywords
Extract Feeds (backups from Firefox 63 and earlier): Find Feeds
Copyright © 2021 Jefferson Scher (BSD-3-Clause License). lz4.js © 2016 Pierre Curto (MIT License; Sept. 1, 2016). FileSaver.js © 2016 Eli Grey (MIT License; v1.3.2). MDN code samples © Mozilla Contributors or Public Domain (License). escapeHtmlEntities() function from Firefox (MPL 2.0). No claim to your data! Updated 2021-06-23. (Oct. 20, 2018 version) (Dec. 23, 2019 version)
I’ve been a long-time Firefox user – for over ten years at this point. I’ve amassed thousands of bookmarks, some of which I have spent time organizing and tagging. As such, lately I was thinking I really should set up some sort of backup system, but I had trouble locating any commands or scripts that could accomplish this.
If you want to jump right to the solutions section, click here, otherwise read on.
Find Your Profile Folder
Pretty much all of your data in Firefox is stored in your profile folder. This is a special folder, whose location is unique to your computer due to its use of profile IDs and OS user directories.
If you have the basic *nix utilities installed, you can use this one-liner to get the path on Windows:
Research
First, let’s investigate how Firefox stores user bookmarks.
The best place to get this information is the Mozilla support page – “Where Firefox Stores User Data”. I’ll supplement this with some additional details below.
Some key things to note, which affect our task:
- Bookmarks are contained in place.sqlite , along with download metadata and browsing history
- This makes extraction more difficult, as this is a special database, can you can’t easily copy & paste out of it, or view it, or easily import it into Firefox or other browsers
- This will be the most up-to-date stored version of your bookmarks, as the automated backup options (see below) either run periodically, or when the browser shuts down. In comparison, places.sqlite is updated in almost real-time as you edit bookmarks in Firefox.
- /Profiles//bookmarkbackups should contain daily backups of bookmarks
- However, these are stored in a somewhat obscure .jsonlz4 file type, which is JSON compressed with a flavor of the LZ4 algorithm
- You can control the file location with config value browser.bookmarks.file
- See this post for details
Converting the .jsonlz4 Bookmarks File(s)
Note: You don’t need to convert the files if all you want them for is a backup that you can re-import into Firefox; Firefox understands this file format and will let you use it as an import, no conversion required.
The bookmarkbackups folder and its .jsonlz4 daily backup files are a nice existing backup to take advantage of, but how can we get the files in plain JSON, so we can do whatever we want with their contents (convert to CSV, cleanup, etc.).
Existing options (found via a quick Google search):
- Everything listed in this thread
- Online tool: Jefferson Scher: “BookBackReader”
- Offline tools:
- C / Binary release: avih/dejsonlz4
- NodeJS / CLI: thrilleratplay/node-jsonlz4-decompress
- Python: TBlue Github Gist
Solutions
Manual Methods
For manual bookmark exporting, there are some nice built-in options. These are covered here, but to summarize:
- Open the Bookmark Library ( CTRL + SHIFT + B , or use Library Button in toolbar)
- Open the Import and Backup menu
- Use either of:
- Backup
- this exports a UTF-8 JSON file, which is not compressed with lz4 – you can open and read this file easily
- This exports a HTML file, which you can easily open with any standard web browser
- The downside is that it is roughly 2x the size of the JSON export, and would be harder to parse if you wanted to automate the transformation of your bookmarks into another format
Also, if you don’t care about backing them up to a specific folder, than using the default automated backups (discussed above, here), might be enough for you.
Automated Methods
For putting together a command / script to grab a Bookmarks backup, I have three main options:
- Hook into the internals of Firefox
- The best place would be the BookmarkJSONUtils.jsm utility – this has a native method for exporting to JSON – exportToFile
- You can actually get to this in the browser, with resource://gre/modules/BookmarkJSONUtils.jsm
- For example, the headless mode of Firefox might let me eval() JS to extract the bookmarks, but you cannot concurrently use that and have an open instance of Firefox with the profile you want to use
- Complicated, and might have issues around concurrent db access
- This is, by far, the easiest option.
- I’ve implemented this below
Automated Methods – Batch Script
I’m not thrilled with it, but here is a batch file I put together to copy the most recent JSON file to my Dropbox. It requires that some standard *nix utilities are installed (these come default with git-bash), and unfortunately, you have to hard-code the backup folder(s). But, it works!
Automated Methods – A Better Solution
If I had a lot more free time, and wanted this badly enough, I would code this as a NodeJS script, and compile it to a portable binary using something like vercel/pkg. If this is something you are interested in doing so yourself, my advice would be to have the script:
- Parse OS environmental variables and paths to find the Firefox user profile folder
- Find the most recent file in the folder
- Decompress it using thrilleratplay/node-jsonlz4-decompress
- Copy the raw and de-decompress versions to the output directly, specified by the user through a CLI argument
- Having the tool copy both versions to output could be made optional
Why hello there! Want to know more about me or get in touch? Check out my contact info and profile links!
Видео: Файл JSONLZ4 - самый простой способ открыть файлы .jsonlz4 в 2020 году.
Содержание:
Многие люди делятся .jsonlz4 файлы, не прилагая инструкции по использованию. Однако не для всех очевидно, кто программирует .jsonlz4 файл можно редактировать, конвертировать или распечатывать с помощью. На этой странице мы стараемся оказать помощь в обработке .jsonlz4 файлы.
В нашей базе данных найдено 1 файловое расширение (а).
- Резервное копирование сжатых закладок Mozilla Firefox
- Проблемы, связанные с файлом .jsonlz4.
.jsonlz4 - Резервное копирование сжатых закладок Mozilla Firefox
В JSONLZ4 файлы архива относятся к Mozilla Firefox. JSONLZ4 Файл представляет собой резервную копию сжатых закладок Mozilla Firefox. Mozilla Firefox - это бесплатный веб-браузер с открытым исходным кодом, разработанный Mozilla Corporation.
Заявка: Mozilla Firefox Категория: Архивные файлы Пантомима: приложение / октет-поток Магия: - / - Псевдонимы: - Mozilla Firefox Compressed Bookmarks Backup связанные расширения: .eappx Пакет зашифрованного приложения Microsoft Windows .zfsendtotarget Архивированная папка Windows .deskthemepack Пакет тем рабочего стола Microsoft Windows 8 .такси Файл кабинета Microsoft .appv Пакет виртуального приложения App-V .waff Интернет-архив Internet Explorer для Mac
Естественно, что другие приложения также могут использовать .jsonlz4 расширение файла. Даже вредоносные программы могут создавать .jsonlz4 файлы. Будьте особенно осторожны с .jsonlz4 файлы поступают из неизвестного источника!
Не удается открыть файл .jsonlz4?
Windows не может открыть этот файл:
Чтобы открыть этот файл, Windows должна знать, какую программу вы хотите использовать для его открытия. Windows может автоматически подключиться к Интернету, чтобы найти его, или вы можете вручную выбрать его из списка программ, установленных на вашем компьютере.
Чтобы избежать этой ошибки, вам необходимо правильно настроить ассоциацию файлов.
- Откройте Панель управления> Панель управления Главная> Программы по умолчанию> Установить связи.
- Выберите тип файла в списке и нажмите «Изменить программу».
Операционные системы
Windows XP / Vista, Windows 7/8, Windows 10, CentOS, Debian GNU / Linux, Ubuntu Linux, FreeBSD, Mac OS X, iOS, Android
Если вы найдете информацию на этой странице полезной, пожалуйста, дайте ссылку на эту страницу.
Если у вас есть полезная информация о .jsonlz4 формат файла, напишите нам!
Кажется, существуют разные способы распаковки JavaScript и браузера, но не существует ли способа преобразовать файлы jsonlz4 во что-то, что unlz4 будет читать?
Я смог распаковать jsonlz4 с помощью lz4json :
FWIW, инструмент andikleen не удалось скомпилировать с ошибкой «неопределенная ссылка на LZ4_decompress_safe_partial» (я установил его liblz4-dev до сборки). Инструмент Avih, OTOH, отлично работал для меня.
Разве не иронично, что организация open-web использует собственный формат сжатия данных пользователя, что делает нетривиальным изучение ваших собственных данных ?!
@ Грэм-Перрин: dejsonlz4 работал очень хорошо для меня. Он не « преобразует файлы jsonlz4 во что-то, что unlz4 будет читать » в соответствии с запросом, а непосредственно распаковывает их. Было бы хорошо сделать это реальным ответом, чтобы сделать его более заметным.
Сохраните этот скрипт в файле, например mozlz4 :
Фактически почти все файлы lz4 профиля Firefox являются файлами mozlz4 . Это означает, что они имеют одинаковый «заголовок формата файла». За исключением одного файла. Я говорю о файле webext.sc.lz4 . Он имеет mozJSSCLz40v001\0 заголовок файла и, возможно, некоторую sc упаковку для упаковки группы файлов в поток байтов.
Существует аддон Firefox для чтения или компресс .mozlz4 текстовые файлы mozlz4-редактировать
Достаточно настойчивый поиск в Google для этого приводит ко многим решениям, но большинство из них, кажется, либо (а) нарушено последующими изменениями в базовых библиотеках, либо (б) излишне сложным (по крайней мере, на мой личный вкус), что делает их неуклюжим заглянуть в существующий код.
Следующее, кажется, работает по крайней мере на Python 2.7 и 3.6 с использованием последней версии привязок Python LZ4 :
Конечно, это не пытается проверить входные данные (или выходные данные), не предназначено для обеспечения безопасности и т. Д., Но если кто-то просто хочет иметь возможность анализировать собственные данные FF, он выполняет основную работу.
Командная строка версии здесь , которые могут быть сохранены в соответствующем каталоге и вызывается из командной строки , как:
Читайте также:
- The best place would be the BookmarkJSONUtils.jsm utility – this has a native method for exporting to JSON – exportToFile
- Backup