19

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
  • 576
  • 6
  • 28

1 Answers1

34

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
  • 516
  • 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