Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I launch Chrome with flags from command line more concisely?

I am developing a WebGL driven application and I want to launch chrome like this from the command line:

open -a Google\ Chrome --args --disable-web-security 

I just don't want to have to type that in every single time. Is there a way to easily turn that into a one word command? I am using a mac if it matters.

like image 869
smuggledPancakes Avatar asked Oct 30 '12 19:10

smuggledPancakes


2 Answers

Just make an alias in your .bashrc or .bash_profile

alias ogc='open -a Google\ Chrome --args --disable-web-security' 

And then reload your shell.

exec $SHELL 

Now, every time you type ogc (or whatever you want to call it) in your terminal, it will run the full command open -a Google\ Chrome --args --disable-web-security

like image 112
Kevin Suttle Avatar answered Oct 11 '22 13:10

Kevin Suttle


This work for me:

  1. Modify the .bash_profile
  2. Write this alias:
 alias cchrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir="/tmp/chrome_dev_session" --disable-web-security' 
  1. Run
exec $SHELL
  1. With the cchrome command open a new windows of chrome with the disable web security to solve the "access-control-allow-origin" problem
like image 43
Antonio Reyes Montufar Avatar answered Oct 11 '22 12:10

Antonio Reyes Montufar