How to use browser Incognito Mode in visual studio when Run a web project
Asked Answered
J

3

44

enter image description here

If i Run the project, it will launch using Google Chrome normal mode. But how can i launch it using Google Chrome Incognito Mode ?

Jeremiad answered 14/6, 2016 at 17:36 Comment(1)
Any Idea how to do this in 2017?Norway
F
80

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

That you can do using Browse With.. option in visual Studio.

Step-1:

Step-2:


Note: You can do the same thing with Firefox and Internet Explorer. Here I'm adding Internet Explorer with the -private option.

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

Fife answered 14/6, 2016 at 17:41 Comment(1)
For Firefox only use -privateVersatile
C
21

For Visual Studio 2017

  1. Select button that usually says IIS Express
  2. Click the down arrow
  3. Select Browse With...

enter image description here

  1. Click Add...

enter image description here

  1. Next to Program write the path to Google Chrome, eg. 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 your friendly name from before (eg. 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 starts in Incognito mode.

Chet answered 5/9, 2018 at 23:54 Comment(0)
A
12

Not the answer, but in case someone stumbles upon this question, looking for the 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 using the Firefox debugging extension with the -private-window argument. Hope it helps.

Acciaccatura answered 6/10, 2017 at 5:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.