≡ Menu

Google Chrome Incognito default startup on OSX

Edit: I found a new method that works across chrome updates. You can read about it here. The old method still works with the same caveat as indicated below.

I’ve recently started using Google Chrome, and while my browsing habits of keeping 30+ tabs open doesn’t mesh well with how Chrome uses memory, the Incognito mode is fantastic for going to friendly sites like FaceBook that share your login cookies/credentials with an ever growing number of sites on the internet.

The following hack will start Chrome up in Incognito mode by default. If you want a “normal” browser, just open a new browser window. Note, this is a ‘I’m not afraid of the shell prompt, I like voiding warranties, and if my computer explodes I’m fine with it’ sort of modification.

In windows land you can do this by right clicking on the desktop icon and editing the properties to add a ‘-incognito’ at the end of the line. Things don’t quite work the same way in OSX.

Without further delay:

bash-3.2$ cd /Applications/Google\ Chrome.app/Contents/MacOS/
bash-3.2$ mv Google\ Chrome Google\ Chrome.real
bash-3.2$ echo '#!/bin/sh' > Google\ Chrome
bash-3.2$ echo 'exec "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome.real" -incognito' >> Google\ Chrome
bash-3.2$ chmod 775 Google\ Chrome

Click on the normal icon, if the app starts up it should be in Incognito mode. If it doesn’t start, fire up the console app and look at the last couple of entries, you may have a typo. If all else fails you can fall back with this:

bash-3.2$ mv Google\ Chrome.real Google\ Chrome

So what does this do? OSX .app bundles contain all the resources for the application. The binary is usually hidden in the MacOS directory. We’ve just created a shell wrapper for that which calls the real binary and passes it the -incognito switch, just like they do on Windows.

Like I said earlier, you have been warned. I’ve been using this for a while now without any problems but my setup is likely different than yours, and this definitely would not fall under “normal” usage for Chrome. Also, note that you will need to do this anytime you update your Chrome installation.

Good luck,

>>> Karl