I am trying to use the new Promise-based WebRTC/Media tools, to get feedback if the user allowed access to the camera and/or microphone as documented here https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
The following code-snippet, simply injected with the browser's developer tools, does never fullfill the Promise on Firefox when access is granted, yet on Chrome it works as expected.
(tested with Firefox 53 32-bit, Chrome 59 64-bit)
navigator.mediaDevices.getUserMedia({
"audio": true,
"video": true
})
.then(() => console.log("OK!"))
.catch(() => console.log("NOPE"))
It appears that the Promise is pending forever.
Steps to reproduce:
Is this a bug in Firefox or is something wrong with the code snippet? To comply with the MDN documentation, i've also tried to use the good'ol functions instead of ES6 arrow functions - with the same effect.
After disabling all addons (especially NoScript - even after setting "scripts globally allowed" to true) it appears to run just fine.
Sorry for the unnecessary question then, i guess, and thanks for reconfirming me, that the problem was not Firefox itself, so got on the right track to find the solution!