如果您在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"
}
]