Create a Shortcut for Chrome on a Mac
To avoid CORs errors you can create your own shortcut
You might be developing and want to always open Chrome on your Mac with web security disabled.
To do so, just use
Automator which manages to help you out and make things just that bit easier when you are developing.
Difficulty: Beginner | Easy | Normal | Challenging
Automator: An application that can help you automate tasks on your Mac
Spotlight: A way of finding files and applications on a Mac
Terminal: A command line interface to control the UNIX-based operating system that underlies the Mac
Opening Chrome with no web-security
Now every-time you want to create an instance of Chrome by typing the following into
open -a Google\ Chrome --args --disable-web-security --user-data-dir
But we don’t want to type this in every time…therefore…
Now we’re talking. Open up spotlight by pressing Command — Space and type
As you might expect,
Spotlight appears on the screen.
A response to the first Window is to press New Document
We can then choose Application
Now find Run Shell Script from the list of objects.
A quick double-click (or drag) makes the main area of
Automator come alive!
We can then add the following script
open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir=/tmp/chrome_dev_test --disable-web-security
in the main part of the screen
When you click run Chrome opens informing you that Web security is turned off.
Great! But we want this to be reusable so we can create a new icon.
So we save with ⌘S.
I called mine “ChromeNoSecurity” as you see.
But I’d like to have a more…appropriate icon.
We can right-click on the icon and select Get Info:
You can now put your own picture icon on top of the existing icon at the top-left hand corner of the window
And… we’re done!
When you want to use a version of Chrome without web security you are likely to want to open it many times.
Rather than copying and pasting a long string of characters, instead you can follow the instructions above, and save some time.
Go on! You know you want to!
The Twitter contact:
Any questions? You can get in touch with me here