run vscode chrome debugger with its extensions

后端 未结 2 993
半阙折子戏
半阙折子戏 2021-01-02 15:56

Is there any way we can launch the chrome window with all the extensions installed on chrome?

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


        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-02 16:29

    While setting the userDataDir property in the launch config to false will allow you to launch Chrome using your user profile, I would highly suggest not going that route. You should want to keep your debugging environment sandboxed and separated from your personal profile. You also probably shouldn't want to enable remote debugging in your regular browsing sessions as well unnecessarily.

    By default, Chrome debugger will create a new profile for your debugging session and will persist til you restart your computer. The trick here is to create a profile just for your workspace. You could then configure this profile to have whatever extensions and other settings that you need. We just need to make it persist permanently so we don't have to reconfigure it again.

    Instead, set the userDataDir property to a path in your .vscode directory (and ignore in your source control). It will create the profile in that directory you set. I use ${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir. Then when you run the debugger, it will create a profile in that directory that should persist indefinitely. You could then install all the extensions you want, all without muddying up your personal profile.

提交回复
热议问题