Skip to content

Instantly share code, notes, and snippets.

View NerdyDeedsLLC's full-sized avatar
💣
Ministry of Code Deletion

Jason Jurusz (@JJ) NerdyDeedsLLC

💣
Ministry of Code Deletion
  • Nerdy Deeds, LLC
  • Kansas City, MO, USA
  • 20:01 (UTC -05:00)
View GitHub Profile
@NerdyDeedsLLC
NerdyDeedsLLC / instructions.md
Last active June 12, 2025 14:58
How to import and export Script Snippets saved inside of Chrome DevTools (plus bonus: retrieve Console command history!)

Snippets - CLI

This is a Mac-Specific set of instructions abridged from my Stack Overflow answer of the same question. I'm a Mac user, and this is a Gist for my own use, really, but if you're a Linux or a - gods help you - Windows user, you can find similar commands there, too, as well.

How Snippets are Stored

Snippets are stored in a sort of "metastorage" internal preferences within Chrome. They are stored, separately, for each Chrome profile present on the system. These are accessible from the file system (and can be copied directly to your pasteboard - on a Mac, specifically) with the following command:

echo "Available Chrome profiles:" && readarray -t profiles < <(find "$HOME/Library/Application Support/Google/Chrome/" -path '*/Profile */Preferences' | sort); PS3='Choose Chrome profile to copy snippets from: '; select PROFILE in "${profiles[@]}"; do cat "$PROFILE" | jq -r '.devtools.preferences."script-snippets"' | pbcopy && echo "Snippets cop