Skip to content

Instantly share code, notes, and snippets.

@danton721
Last active February 20, 2023 05:42
Show Gist options
  • Save danton721/38a64eb8c0688ded2a5f741a2e50c667 to your computer and use it in GitHub Desktop.
Save danton721/38a64eb8c0688ded2a5f741a2e50c667 to your computer and use it in GitHub Desktop.
Copy localStorage from a domain to another

Copy localStorage from a domain to another

In a chrome console do the following:

  1. Copy JSON of all Local Storage
JSON.stringify(localStorage)
  1. Copy JSON to clipboard

  2. In another chrome console, do the following

const items = JSON.parse("PASTE_HERE_JSON")
Object.keys(items).forEach((i) => {localStorage.setItem(i, items[i])})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment