Skip to content

Instantly share code, notes, and snippets.

@sorja
Last active March 25, 2018 16:58
Show Gist options
  • Save sorja/3adf85deead8e09687614242eb5d564b to your computer and use it in GitHub Desktop.
Save sorja/3adf85deead8e09687614242eb5d564b to your computer and use it in GitHub Desktop.
Launch google chrome (canary) without web security, using custom profile. This example is missing the (optional) piping of output to /dev/null
# Append to .bashrc, .bash_profile or other similar
# Open google chrome canary without web security, and with devtools defaulting to open, using dev profile
function chromex() {
local chrome_canary="/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"
# chrome://version/
local user_data_dir="$HOME/Library/Application Support/Google/Chrome Canary"
# Each profile is a subdirectory (often Default) within the user data directory.
local profile_path="Profile 1"
"$chrome_canary" --args --disable-web-security --user-data-dir="$user_data_dir" --profile-directory="$profile_path" --auto-open-devtools-for-tabs "$*"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment