Created
June 1, 2015 20:37
-
-
Save rubysolo/f900572da417fc35db56 to your computer and use it in GitHub Desktop.
create unsafe chrome app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
# usage: | |
# ./unsafe_chrome.sh Developer #=> creates a "Google Chrome Developer" app | |
PROFILE_NAME=$1 | |
mkdir -p "/Applications/Google Chrome $1.app/Contents/MacOS" | |
F="/Applications/Google Chrome $1.app/Contents/MacOS/Google Chrome $1" | |
cat > "$F" <<\EOF | |
#!/bin/bash | |
# | |
# Google Chrome for Mac with additional profile. | |
# | |
# Name your profile: | |
EOF | |
echo "PROFILE_NAME='$PROFILE_NAME'\n" >> "$F" | |
cat >> "$F" <<\EOF | |
# Store the profile here: | |
PROFILE_DIR="/Users/$USER/Library/Application Support/Google/Chrome/${PROFILE_NAME}" | |
# Find the Google Chrome binary: | |
CHROME_BIN="/Users/$USER/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" | |
if [[ ! -e "$CHROME_BIN" ]]; then | |
CHROME_BIN="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" | |
else | |
echo "ERROR: Can not find Google Chrome. Exiting." | |
exit -1 | |
fi | |
# Start me up! | |
exec "$CHROME_BIN" --disable-web-security --enable-udd-profiles --user-data-dir="$PROFILE_DIR" | |
EOF | |
sudo chmod +x "$F" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment