Skip to content

Instantly share code, notes, and snippets.

@gm3dmo
Last active October 13, 2023 10:28
Show Gist options
  • Save gm3dmo/98247152b375b84ac7a9d4cbb7f92e3b to your computer and use it in GitHub Desktop.
Save gm3dmo/98247152b375b84ac7a9d4cbb7f92e3b to your computer and use it in GitHub Desktop.

Chrome Profiles

Matching profile numbers with names

We want to be able to start a Chrome session with the profile of a particular user

cat /Users/${USER}/Library/Application\ Support/Google/Chrome/Local\ State  |
jq -r ' .profile.info_cache | . '

This will output the whole json data for user profiles. We want to get only the profile name for "banned-from-urgent":

cat /Users/${USER}/Library/Application\ Support/Google/Chrome/Local\ State  |
jq -r ' .profile.info_cache | to_entries|map(.key +": " + .value.name)|.[]' |
sort -k2,2n

The second one will output something like:

Profile 4: proto-mullet
Profile 5: Bob Wickham
Profile 6: okta developer account
Profile 9: Mona
Profile 11: Pip Crispy
Profile 12: Person 1
Profile 13: banned-from-urgent
Profile 14: Robin of Loxley
Profile 15: Roger de Courcey
Profile 16: Grillpan Eddie
Profile 17: Monty Bojangles
Profile 19: pet-ghes

You can then start a Chrome Browser with that profile number (this one would get me a session for "banned-from-urgent":

open -n -a "Google Chrome" --args --profile-directory="Profile 13" "http://$H"·
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment