2017-06-07 52 views
0

如何在VS代碼中的launch.json文件中配置沒有網絡安全功能的Chrome瀏覽器?我安裝了VS代碼擴展調試器的Chrome我launch.json似乎如此:與網絡證券在VS代碼中啓動沒有網絡安全功能的Chrome

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

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

此代碼啓動Chrome瀏覽器。如何配置此文件,以便我可以利用這個參數啓動Chrome:chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security

回答

1

只需添加

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

所以你launch.json會像:

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

    { 
     "type": "chrome", 
     "request": "launch", 
     "name": "Launch Chrome", 
     "url": "http://localhost:8100/", 
     "runtimeArgs": [ 
     "--disable-web-security" 
     ], 
     "webRoot": "${workspaceRoot}" 
    } 
    ] 
}