Reputation: 923
I'm running source codes on VS Code with its chrome debugger. But, whenever running the chrome debugger, the chrome browser runs in incognito mode. In this mode, any chrome extensions and context can't be accessible.
Is there anyone who knows how to fix this issue, not running the chrome debugger in incognito mode?
This is my VS Code chrome debugger configuration.
{ "configurations": [
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
]
}
Upvotes: 12
Views: 7350
Reputation: 1616
I was wondering the same thing when I started using the VS-Code chrome debugger. But it turned out it was just a new chrome instance. If you truly are in incognito something is not working as it should.
I confused it with being incognito mode until I realised that it's just running with a fresh user profile w/out any extensions installed. That happens because vs-code starts chrome w/ a custom data-dir (which is how it should be), meaning you will have to install extensions that you had before again.
I assume this happens to prevent conflicts.
A blog post about that from google
As @Momia pointed out in his answer, you can disable this behaviour by disabling the userDataDir
configuration like such:
{ "configurations": [
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"userDataDir": false // this line disabled VSCode from running in a custom data-dir
]
}
Upvotes: 6
Reputation: 71
Add the code in "configurations":
"runtimeArgs": ["--incognito"]
Upvotes: 7
Reputation: 61
To avoid incognito mode, you can set userDataDir to false. You can find more info here
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "Launch Chrome",
"type": "chrome",
"url": "http://localhost:3000",
"userDataDir": false,
"webRoot": "${workspaceFolder}/src"
}
]
}
Upvotes: 6