[英]How do I enable editable debugging of files within VS Code w/ Chrome Debugging?
環境:
{
"type": "pwa-chrome",
"request": "attach",
"name": "Attach Chrome Debugging to Browser for VSCode",
"port": 9222,
"url": "http://localhost:8888/",
"urlFilter": "http://localhost:8888/*",
"webRoot": "${workspaceFolder}"
}
/
)/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --remote-debugging-port=9222 --user-data-dir=remote-debug-profile
debugger;
向我的代碼添加斷點debugger;
我的 HTML 文件中的語句。使用“附加”我希望能夠在 VSCode 中的實際文件內激活斷點,而不是“只讀”版本。
我花了大約兩個小時研究這個問題,據我所知,它與以下方面有關:
--user-data-dir=remote-debug-profile
行。"type": "chrome"
"webRoot": "*/thedirectpathtomyprojectdirectory*"
"webRoot": "${workspaceFolder}/src"
"userDataDir": "/Library/Application\\ Support/Google/Chrome/Profile 1"
"userDataDir": "/Library/Application\\ Support/Google/Chrome"
"sourceMapPathOverrides": {"webpack://?:*/*": "${workspaceFolder}/*"}
"sourceMaps": true
問題在於--user-data-dir=remote-debug-profile
見這里 - https://chromium.googlesource.com/chromium/src/+/HEAD/docs/user_data_dir.md
您需要提供實際的目錄路徑。
將您當前的用戶數據文件夾復制到您的自定義目錄
使用 --user-data-dir 參數將 chrome 快捷方式指向自定義目錄
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.