如果您在launch.json
中指定userDataDir
,它将为您启动一个新的Chrome实例。除非您指定runtimeArgs
和runtimeExecutable
,否则它也会在第一次启动后每次启动时提供“恢复页面”。下面是一个样本launch.json
:
"configurations": [
{
"name": "Launch localhost",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
},
"userDataDir": "${workspaceRoot}.vscode/chrome",
"runtimeArgs": [
"--disable-infobars --disable-session-crashed-bubble"
],
"runtimeExecutable": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
}
]