Skip to content

Instantly share code, notes, and snippets.

@RobPruzan
Created August 21, 2025 02:04
Show Gist options
  • Save RobPruzan/f0792607b44564c86871d2f83ef7887f to your computer and use it in GitHub Desktop.
Save RobPruzan/f0792607b44564c86871d2f83ef7887f to your computer and use it in GitHub Desktop.
#!/bin/bash
install_chrome_extension () {
if [[ "$OSTYPE" == "darwin"* ]]; then
preferences_dir_path="$HOME/Library/Application Support/Google/Chrome/External Extensions"
pref_file_path="$preferences_dir_path/$1.json"
else
preferences_dir_path="/opt/google/chrome/extensions"
pref_file_path="$preferences_dir_path/$1.json"
fi
upd_url="https://clients2.google.com/service/update2/crx"
mkdir -p "$preferences_dir_path"
echo "{" > "$pref_file_path"
echo " \"external_update_url\": \"$upd_url\"" >> "$pref_file_path"
echo "}" >> "$pref_file_path"
echo Added \""$pref_file_path"\" ["$2"]
}
install_chrome_extension "nhdogjmejiglipccpnnnanhbledajbpd" "vue dev tools"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment