Scott Hanselman

Visual Studio Web Development Tip - Add Chrome Incognito Mode as a Browser

June 17, '15 Comments [38] Posted in VS2015
Sponsored By

Here's a little Visual Studio web development tip that I've been using lately. You know how Visual Studio picks up your installed browsers and has them available as a dropdown list?

List of Browsers in Visual Studio

I found it very useful when debugging to add Google Chrome's Incognito Mode as a browser of its own.

Pull down the chevron and click Browse With...

Browse With Menu

Add Chrome from either it's standard or user location:

  • System: C:\Program Files (x86)\Google\Chrome\Application\
  • User: C:\Users\UserName\AppData\Local\Google\Chrome\Application

Then add --incognito as command line switch and name the browser something like "Google Chrome - Incognito."

You can do the same thing with Firefox and Internet Explorer.

Here I'm adding Internet Explorer with the -private option.

Internet Explorer Private mode

This is a useful thing for developers if you're doing anything with cookies or caching and you've found yourself clearing the cache or browser history a lot.

Added Internet Explorer Private Mode to Visual Studio

Question for you dear Reader - Is this a feature you would want by default? Would you want not just every browser added, but also the Private Mode for each as well?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Wednesday, June 17, 2015 7:52:18 AM UTC
Great article! And yes, having this by default would be nice :)
Wednesday, June 17, 2015 7:55:58 AM UTC
I think having this as default would be cool, but I also love how simple it is to add them as browsers as well.
Brian Honde
Wednesday, June 17, 2015 8:22:06 AM UTC
Absolutely! =)
Wednesday, June 17, 2015 8:25:00 AM UTC
Yes, that would be cool
Wednesday, June 17, 2015 8:38:58 AM UTC
There's a feature in Chrome: if you have dev panel opened and you click and hold reload button (UI button, not F5), it shows reload options including clear cache
Wednesday, June 17, 2015 8:57:53 AM UTC
This would be a great addition!
Wednesday, June 17, 2015 9:03:55 AM UTC
Yes, I think it'd be very useful to launch browsers in incognito/private mode as an option in Visual Studio.
Wednesday, June 17, 2015 9:36:16 AM UTC
this is an awesome piece
Oduwole Oluwasegun
Wednesday, June 17, 2015 10:07:58 AM UTC
That would be nice! I have never think of it before.
Wednesday, June 17, 2015 11:42:29 AM UTC
This is great, thanks! Yes, I use incognito all the time for development, not just because of cache/history, but also to have a plug-in free development environment. They can really get in the way sometimes, especially my password manager always trying to save my dummy test account passwords!

Having it built in would be nice, but not such a big deal now that you've showed us how easy it is to add it ourselves. Thanks!
Alexander DiMauro
Wednesday, June 17, 2015 12:54:48 PM UTC
I'd definitely like to see this as default.

I've previously tried to add IE using the -private flag, it works fine, until you close VS (2013 Community), then it always launches in normal mode after that. Chrome seems to work though.

Wednesday, June 17, 2015 12:56:49 PM UTC
For Firefox it should be "firefox.exe -private-window".
Wednesday, June 17, 2015 2:30:17 PM UTC
Yes, but I now know to do this for myself, and I'm happy to do it.
John Dunagan
Wednesday, June 17, 2015 2:54:02 PM UTC
In Chrome DevTools, there is a setting "Disable cache (while DevTools is open)". I find that option suits my needs just fine. I rarely don't want to store cookies/local storage while developing.
Wednesday, June 17, 2015 3:09:40 PM UTC
Would definitely want this is a feature out of the box!
Wednesday, June 17, 2015 4:38:46 PM UTC
Nice post. With recently testing authentication with Azure Active Directory I found it necessary to use Icognito so that my windows live cached credentials don't interfere with the AAD domain that I am using/testing with.

Shipping with these would be a nice touch.
Wednesday, June 17, 2015 5:03:43 PM UTC
Wow. Nice.
Even better if it became a built-in option in
Vitor Canova
Wednesday, June 17, 2015 5:57:01 PM UTC
Great tip!

Definitely +1 for having it as a default...
Wednesday, June 17, 2015 10:33:44 PM UTC
+1 , although we now know what need to be done
Wednesday, June 17, 2015 10:34:16 PM UTC
would be nice to have it by default.
Thursday, June 18, 2015 12:07:03 AM UTC
Thanks for the nice tip. Yep, having this by default would be lovely.
Thursday, June 18, 2015 8:20:19 AM UTC
If at all it is wanted, Google Chrome should always be run with DropMyRights.exe - from another MS employee. Still runs apps with lesser privilegs than the default lower privileges of Windows Vista/7/8.
Thursday, June 18, 2015 1:41:01 PM UTC
Thanks for this great tip!
These would be very useful by default. It would be even more useful if I could still hit javascript file breakpoints in VS when I'm using the "Internet Explorer - Incognito" option, but the symbols aren't loading when I select my new -private IE instance. (Although I'm still on VS2012, so maybe it's just that.)
Thursday, June 18, 2015 4:00:14 PM UTC
Definitely yes, having private mode by default is better than adding it manually. There is no much difference for single machine, but when it comes to teaching newbies and dealing with development VMs - that's reasonable.
Thursday, June 18, 2015 10:03:03 PM UTC
Definitely would love to have this out of the box!
Friday, June 19, 2015 3:06:44 AM UTC
Thank you for the great tip Scott. Would be nice to have it by default.
Friday, June 19, 2015 11:35:36 AM UTC

There's a feature in Chrome: if you have dev panel opened and you click and hold reload button (UI button, not F5), it shows reload options including clear cache

This is a great tip too!
Friday, June 19, 2015 5:23:39 PM UTC
Very good feature, but who clicks F5 to debug a real website to do manual testing?
Friday, June 19, 2015 6:52:57 PM UTC
I'd rather not have the default menu laden with options; the option to change the content of the menu is right there with the items. Don't overfill our UI with stuff we can easily add ourselves!
Friday, June 19, 2015 10:42:22 PM UTC
When debugging "--disable-web-security" is another useful command line switch in Chrome to disable same origin policy.
Sunday, June 21, 2015 8:54:54 AM UTC
Simple but great tips. This should be a default feature
Sunday, June 21, 2015 8:26:32 PM UTC
Yes please, that would be brilliant!
Wednesday, June 24, 2015 9:15:55 PM UTC
Yes! We'd love this feature. And thanks for the tip!
Thursday, June 25, 2015 3:17:14 AM UTC
Thanks, Scott. Always good inputs :)
Monday, July 06, 2015 6:36:02 AM UTC
Better options to devs who deal with lot of cookies and caching.
Thursday, July 16, 2015 3:36:50 PM UTC
Great tip!
Sunday, July 19, 2015 12:53:06 PM UTC
Would love that feature added in. Working on a project now that I need to clear out cookies constantly
Thursday, August 20, 2015 4:17:51 PM UTC
I am using VS 2015 and the dropdown only has installed browsers with no option to add more. Does anyone know how to do this in VS 2015?
Rick Stone
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.