vscode-js-debug: Instant crash when accessing navigator.getUserMedia

Attempting to access the camera or microphone either through code or the console will result in the chrome instance crashing

  • VS Code Version: 1.43.0
  • Chrome Version 80
  • Log file (set "trace": true in launch config):

Steps to reproduce:

  1. Start a Chrome instance using VS Code Chrome Debug
  2. Open console and paste in this line: navigator.getUserMedia({video:true},devices=>{console.log(‘hello’)},err=>{console.log(err)})
  3. Allow access to the camera
  4. Chrome will crash without a trace

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 31 (12 by maintainers)

Most upvoted comments

We’re still waiting on work from the Chromium team for this

I was able by allowing vscode permissions for camera and microphone, but I had to create these entitled permissions in first place.

Have a look at this: https://github.com/microsoft/vscode/issues/95062#issuecomment-751241372

Now all works for me when started directly from vscode!

MacOS Catalina (10.15.7)

@isometriq thank you, I tried the solution you provided, and it works!

but I had to change the inserted code, because there were some other required fields in my access table:

INSERT into access (service, client, client_type, allowed, prompt_count) VALUES ("kTCCServiceCamera","com.microsoft.VSCode",0, 1, 0);
INSERT into access (service, client, client_type, allowed, prompt_count) VALUES ("kTCCServiceMicrophone","com.microsoft.VSCode",0, 1, 0);

Work around:

Start Chrome with debug enabled

OSX:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

use attach in launch.json

“name”: “Chrome”, “type”: “chrome”, “request”: “attach”, “port”: 9222, “webRoot”: “${workspaceFolder}/src”,

Hi, still no updates on this? My browser crashes for me too when trying to allow microphone permissions.

Doesn’t seem to happen on Windows. Tracking upstream with: https://bugs.chromium.org/p/chromium/issues/detail?id=1066155

You can use an “attach” type config to work around this. I don’t have anything better, sorry.