Last active
December 6, 2016 22:49
-
-
Save ara4n/e2eaa28ca93ebd9fde88feb4f0ba0fc5 to your computer and use it in GitHub Desktop.
Backup & restore of E2E session data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// backup (tested in Chrome console...). N.B. this does *NOT ENCRYPT THE SESSION KEYS!* | |
Object.keys(window.localStorage).forEach(k=>{ | |
if (k.match(/^session\.e2e\.sessions\/|^session\.e2e\.inboundgroupsessions\//)) localStorageCopy[k] = window.localStorage[k]; | |
}); | |
blob = new Blob([JSON.stringify(localStorageCopy, null, '\t')], { type: "text/plain;charset=utf-8" }); | |
fetch('https://raw.githubusercontent.com/eligrey/FileSaver.js/master/FileSaver.js') | |
.then(response => response.text()) | |
.then(text => { eval(text); saveAs(blob, "e2e-backup.json") }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment