Scott Hanselman

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

June 17, 2015 Comment on this post [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
Hosting By
Hosted in an Azure App Service
June 17, 2015 11:52
Great article! And yes, having this by default would be nice :)
June 17, 2015 11:55
I think having this as default would be cool, but I also love how simple it is to add them as browsers as well.
June 17, 2015 12:22
Absolutely! =)
June 17, 2015 12:25
Yes, that would be cool
June 17, 2015 12:38
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
June 17, 2015 12:57
This would be a great addition!
June 17, 2015 13:03
Yes, I think it'd be very useful to launch browsers in incognito/private mode as an option in Visual Studio.
June 17, 2015 13:36
this is an awesome piece
June 17, 2015 14:07
That would be nice! I have never think of it before.
Abe
June 17, 2015 15:42
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!
June 17, 2015 16:54
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.

June 17, 2015 16:56
For Firefox it should be "firefox.exe -private-window".
June 17, 2015 18:30
Yes, but I now know to do this for myself, and I'm happy to do it.
June 17, 2015 18:54
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.
June 17, 2015 19:09
Would definitely want this is a feature out of the box!
June 17, 2015 20:38
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.
June 17, 2015 21:03
Wow. Nice.
Even better if it became a built-in option in v.next.
June 17, 2015 21:57
Great tip!

Definitely +1 for having it as a default...
June 18, 2015 2:33
+1 , although we now know what need to be done
June 18, 2015 2:34
would be nice to have it by default.
June 18, 2015 4:07
Thanks for the nice tip. Yep, having this by default would be lovely.
June 18, 2015 12:20
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.
June 18, 2015 17:41
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.)
June 18, 2015 20:00
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
June 19, 2015 2:03
Definitely would love to have this out of the box!
June 19, 2015 7:06
Thank you for the great tip Scott. Would be nice to have it by default.
June 19, 2015 15:35

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!
June 19, 2015 21:23
Very good feature, but who clicks F5 to debug a real website to do manual testing?
June 19, 2015 22:52
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!
June 20, 2015 2:42
When debugging "--disable-web-security" is another useful command line switch in Chrome to disable same origin policy.
Per
June 21, 2015 12:54
Simple but great tips. This should be a default feature
June 22, 2015 0:26
Yes please, that would be brilliant!
June 25, 2015 1:15
Yes! We'd love this feature. And thanks for the tip!
June 25, 2015 7:17
Thanks, Scott. Always good inputs :)
July 06, 2015 10:36
Better options to devs who deal with lot of cookies and caching.
July 16, 2015 19:36
Great tip!
July 19, 2015 16:53
Would love that feature added in. Working on a project now that I need to clear out cookies constantly
August 20, 2015 20:17
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?

Comments are closed.

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