Skip to content

Instantly share code, notes, and snippets.

@JohnStarich
Created July 4, 2022 20:48
Show Gist options
  • Save JohnStarich/7660d1934a426510828bdaa93b5a76d8 to your computer and use it in GitHub Desktop.
Save JohnStarich/7660d1934a426510828bdaa93b5a76d8 to your computer and use it in GitHub Desktop.
Starts Google Chrome without CORS restrictions for local development.
#!/usr/bin/env bash
# Currently works on macOS. Can work with other OS's if the path to
# Chrome's (or Chromium's) executable is changed.
dir=~/.config/chrome-no-cors
mkdir -p "$dir"
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
--disable-web-security \
--user-data-dir="$dir" \
--no-default-browser-check \
--no-first-run \
"$@"
@JohnStarich
Copy link
Author

Definitely only use this for local development. Disabling web security can be pretty bad if a website exploits it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment