Skip to content

Instantly share code, notes, and snippets.

@shufengh
Created July 11, 2019 05:23
Show Gist options
  • Select an option

  • Save shufengh/e331c3d9a91d142dc0786ba6ddc95872 to your computer and use it in GitHub Desktop.

Select an option

Save shufengh/e331c3d9a91d142dc0786ba6ddc95872 to your computer and use it in GitHub Desktop.
How to export content in Chrome's local storage for a website

Original idea is from this post

  1. Open a tab and navigate to the website where you have content to export.

  2. Open devtools and switch to the console tab.

  3. Copy and paste the following snippet in the console and Chrome should ask you to save the output file

var obj = JSON.stringify(localStorage, null, 4)
var vLink = document.createElement('a')
vBlob = new Blob([obj], {type: "octet/stream"})
vUrl = window.webkitURL.createObjectURL(vBlob);
vLink.setAttribute('href', vUrl);
vLink.setAttribute('download', vUrl.split('/')[2] + '-export.json'); // give you the website name + "export.json"
vLink.click();
  1. Profit!
@hym3242
Copy link
Copy Markdown

hym3242 commented Apr 21, 2026

I tried to use this to transfer my telegram web to another machine. The script worked fine, but telegram detected the tampering and logged me out :(
A note for others that may try to do something similar to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment