
- #Extract link sessionrestore jsonlz4 how to#
- #Extract link sessionrestore jsonlz4 update#
- #Extract link sessionrestore jsonlz4 code#
- #Extract link sessionrestore jsonlz4 mac#
I'm trying to use Method 2 Example from the lz4-java github, and a comment here says that the file should be standard lz4 if we skip the 12-byte header. I was hoping that the lz4-pure-java library could decompress it to json. Updating documentation strings, function name and any further refactoring is left for exercise.I'm trying to decode the jsonlz4 file that contains my saved tabs from Firefox (saved in %appdata%\Mozilla\Firefox\Profiles\fault-release\sessionstore-backups\recovery.jsonlz4, in the hope of eventually being able to parse the json and extract the URLs in my tabs and maybe other data from my session.

(let* ((path "~/.mozilla/firefox//sessionstore-backups/recovery.jsonlz4") "Reads chromium current session and converts it to org-mode chunk."
#Extract link sessionrestore jsonlz4 update#
To extract urls, try this in terminal: $ lz4jsoncat recovery.jsonlz4 | grep -oP '"(http.+?)"' | sed 's/"//g' | sort | uniqĪnd update save-chromium-session with: (defun save-chromium-session () If Firefox is not running, recovery.jsonlz4 will not be present, but use previous.jsonlz4 instead. Session data (at the time of writing this post) is stored in $HOME/.mozilla/firefox//sessionstore-backups/recovery.jsonlz4.
#Extract link sessionrestore jsonlz4 how to#
If you are using Firefox (recent versions) and would like to pull session urls, here is how to do it.įirst, download and compile lz4json, small tool that will decompress Mozilla lz4json format, where Firefox stores session data. Make sure to read documentation for this variable.ĭon't forget to put session file in git, mercurial or svn and enjoy the fact that you will never loose your session history again :) What about Firefox?
#Extract link sessionrestore jsonlz4 code#
To actually open tabs, elisp code will use browse-url and it can be further customized to run Chromium, Firefox or any other browser with browse-url-browser-function variable. But, you can easily edit those and keep session file lean and clean. Note that hack for reading Chromium session isn't perfect: strings will read whatever looks like string and url from binary database and sometimes that will yield small artifacts in urls. Here is how I use it, with randomly generated data for the purpose of this text: #+TITLE: Browser sessions

To restore it back, put cursor on desired date and run M-x restore-chromium-session. Or whatever urls are running in Chromium instance. (ln (replace-regexp-in-string "\n" "" ln)))Įvaluate above code, open new org-mode file and call M-x save-chromium-session. Make sure to put cursor on date heading that contains list of urls." "Restore session, by openning each link in list with (browse-url). (let* ((cmd "strings ~/'.config/chromium/Default/Current Session' | 'grep' -E '^https?://' | sort | uniq") jsonlz4 file stores backup of bookmarks in JSON file (JavaScript object notation) format and uses data compression.
#Extract link sessionrestore jsonlz4 mac#
"Reads chromium current session and generate org-mode heading with items." File extension jsonlz4 is mainly associated with Firefox, a web browser for Microsoft Windows, Mac and Linux operating systems. Long time ago I found this trick: Get the currently open tabs in Google Chrome via the command line and with some elisp sugar and coffee, here is the code: (require 'cl-lib) What would be better for that than good old org-mode ) My main goal was it to be browser agnostic and session links had to be stored in text file, so I can enjoy all the goodies of plain text file. Or simply, you'd like to remember workflow (and tabs) you had few days ago.Īfter I decided to ditch all extensions from Chromium except uBlock Origin, it was time to look for alternative.

Very useful, especially if you are like me, switching between multiple "mind sessions" during the day - research, development or maybe news reading. I was big fan of Session Manager, small addon for Chrome and Chromium that will save all open tabs, assign the name to session and, when is needed, restore it.
