How to use incognito browser mode in visual studio when starting a web project

enter image description here

If I run the project, it will start using normal Google Chrome mode . But how can I launch it using Google Chrome Incognito mode?

+14
source share
3 answers

It is very simple with visual studio 2015/2017 . You just need to add --incognito as a command line switch and name the browser something like this: Google Chrome - Incognito .

This can be done using the Browse option using ... in Visual Studio. Check out this link, here you will find the details that you want. Chrome incognito mode as a browser.

For
Google Chrome: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --incognito
Firefox: "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -private-window
Internet Explorer / Microsoft Edge: "C:\Program Files\Internet Explorer\iexplore.exe" -private

+27
source

For Visual Studio 2017

  1. Selection button, which is usually written IIS Express
  2. Press down arrow
  3. Choose Browse With...

enter image description here

  1. Click Add...

enter image description here

  1. Next to Program write the path to Google Chrome, for example. C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
  2. Next to Arguments write --incognito
  3. Next to Friendly name write Google Chrome (Incognito) (or whatever suits your needs)

enter image description here

  1. Click OK
  2. Select a name you previously understood (for example, Google Chrome (Incognito) ) and click Set as Default

enter image description here

Now when you click the play button next to IIS Express, Google Chrome launches in incognito mode.

+11
source

Not an answer, but if someone came across this question while looking for a Visual Studio Code solution, this worked for me:

 { "version": "0.2.0", "configurations": [ { "type": "chrome", "request": "launch", "name": "Chrome: localhost", "url": "http://localhost:8080", "webRoot": "${workspaceRoot}/app" }, { "type": "chrome", "request": "launch", "runtimeArgs": [ "--incognito" ], "name": "Incog Chrome: localhost", "url": "http://localhost:8080", "webRoot": "${workspaceRoot}/app" } ] } 

However, this does not currently work with the Firefox debug extension with the -private-window argument. Hope this helps.

+8
source

All Articles