21

How can I configure the Chrome Browser without web-security in launch.json file in VS Code? I installed the VS Code extension Debugger for Chrome and my launch.json seems so:

{
  "version": "0.2.0",
  "configurations": [

    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome",
      "url": "http://localhost:8100/",
      "webRoot": "${workspaceRoot}"
    }
  ]
}

This code launch Chrome with web-securities. How can I configure this file so that I can launch Chrome with this parameter: chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security

Ramosta
  • 626
  • 1
  • 7
  • 29

1 Answers1

38

just add

"runtimeArgs": [
   "--disable-web-security"
],

So your launch.json will look like:

{
  "version": "0.2.0",
  "configurations": [

    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome",
      "url": "http://localhost:8100/",
      "runtimeArgs": [
         "--disable-web-security"
       ],
      "webRoot": "${workspaceRoot}"
    }
  ]
}
mumblesNZ
  • 556
  • 4
  • 6
  • 3
    This worked for me on Windows machine `"runtimeArgs": ["--disable-web-security","--user-data-dir=c:\\chrome-browser"]`. – Amit Bhagat Jul 18 '19 at 08:12
  • For me where `type` was `blazorwasm` putting this in `browserConfig` worked. `"browserConfig": { "runtimeArgs": ["--disable-web-security","--user-data-dir=c:\\chrome-browser"]},` – Brad Sep 29 '22 at 02:37