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, 17 June 2015 07:52:18 UTC
Great article! And yes, having this by default would be nice :)
Wednesday, 17 June 2015 07:55:58 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, 17 June 2015 08:22:06 UTC
Absolutely! =)
miniBill
Wednesday, 17 June 2015 08:25:00 UTC
Yes, that would be cool
Giancarlo
Wednesday, 17 June 2015 08:38:58 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
AP
Wednesday, 17 June 2015 08:57:53 UTC
This would be a great addition!
carstorm
Wednesday, 17 June 2015 09:03:55 UTC
Yes, I think it'd be very useful to launch browsers in incognito/private mode as an option in Visual Studio.
Wednesday, 17 June 2015 09:36:16 UTC
this is an awesome piece
Oduwole Oluwasegun
Wednesday, 17 June 2015 10:07:58 UTC
That would be nice! I have never think of it before.
Wednesday, 17 June 2015 11:42:29 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, 17 June 2015 12:54:48 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.

Will
Wednesday, 17 June 2015 12:56:49 UTC
For Firefox it should be "firefox.exe -private-window".
Kolthor
Wednesday, 17 June 2015 14:30:17 UTC
Yes, but I now know to do this for myself, and I'm happy to do it.
John Dunagan
Wednesday, 17 June 2015 14:54:02 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.
Mike
Wednesday, 17 June 2015 15:09:40 UTC
Would definitely want this is a feature out of the box!
Wednesday, 17 June 2015 16:38:46 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, 17 June 2015 17:03:43 UTC
Wow. Nice.
Even better if it became a built-in option in v.next.
Vitor Canova
Wednesday, 17 June 2015 17:57:01 UTC
Great tip!

Definitely +1 for having it as a default...
Wednesday, 17 June 2015 22:33:44 UTC
+1 , although we now know what need to be done
subrata
Wednesday, 17 June 2015 22:34:16 UTC
would be nice to have it by default.
Thursday, 18 June 2015 00:07:03 UTC
Thanks for the nice tip. Yep, having this by default would be lovely.
David
Thursday, 18 June 2015 08:20:19 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, 18 June 2015 13:41:01 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.)
Jennifer
Thursday, 18 June 2015 16:00:14 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.
Max
Thursday, 18 June 2015 22:03:03 UTC
Definitely would love to have this out of the box!
Friday, 19 June 2015 03:06:44 UTC
Thank you for the great tip Scott. Would be nice to have it by default.
Friday, 19 June 2015 11:35:36 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!
JasonBSteele
Friday, 19 June 2015 17:23:39 UTC
Very good feature, but who clicks F5 to debug a real website to do manual testing?
Friday, 19 June 2015 18:52:57 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!
Tobias
Friday, 19 June 2015 22:42:22 UTC
When debugging "--disable-web-security" is another useful command line switch in Chrome to disable same origin policy.
Per
Sunday, 21 June 2015 08:54:54 UTC
Simple but great tips. This should be a default feature
Sunday, 21 June 2015 20:26:32 UTC
Yes please, that would be brilliant!
Wednesday, 24 June 2015 21:15:55 UTC
Yes! We'd love this feature. And thanks for the tip!
Thursday, 25 June 2015 03:17:14 UTC
Thanks, Scott. Always good inputs :)
David
Monday, 06 July 2015 06:36:02 UTC
Better options to devs who deal with lot of cookies and caching.
Siva
Thursday, 16 July 2015 15:36:50 UTC
Great tip!
Sunday, 19 July 2015 12:53:06 UTC
Would love that feature added in. Working on a project now that I need to clear out cookies constantly
Brian
Thursday, 20 August 2015 16:17:51 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.