Skip to content

Instantly share code, notes, and snippets.

@tystr
Created May 3, 2019 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tystr/e865496a2a00d2dbeb1a5d92291d0552 to your computer and use it in GitHub Desktop.
Save tystr/e865496a2a00d2dbeb1a5d92291d0552 to your computer and use it in GitHub Desktop.
Bash script to launch chrome in app mode on macOS
#!/bin/bash
# Launches chrome in app mode using the first argument to this command as the url.
if [ -z "$1" ]; then
echo "You must specify a full URL."
exit 1;
elif [[ ! $1 =~ ^https?:\/\/ ]]; then
echo "Url must begin with \"http://\" or \"https://\""
exit 1;
fi
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --app="$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment