Closed Bug 1681772 Opened 11 months ago Closed 10 months ago

Audio input device labels gotten by navigator.mediaDevices.enumeratedDevices() are empty


(Core :: Audio/Video, defect, P3)




86 Branch
Tracking Status
firefox86 --- fixed


(Reporter: amejiamarmol, Assigned: padenot)



(1 file)

Original issue Fenix#16956

Steps to reproduce

  1. Run the following in the console
navigator.mediaDevices.getUserMedia({audio: true}).then(() => {
  navigator.mediaDevices.enumerateDevices().then(devices => {
    for (const device of devices)
  1. Allow audio device permission if a dialog appears
  2. Check the results

Expected behavior

Audio input devices and video input devices labels are non-empty.

Actual behavior

Audio input devices labels are empty while video input devices labels are non-empty.

On Desktop/Android Chrome and Desktop Firefox the both labels are non-empty. So it may be Fenix specific problem.

Device information

  • Android device: Samsung Galaxy 8+
  • Fenix version: Nightly 201203 17:01 (Build #2015779275)

I'll do something today so that it's non-empty. We're not quite ready to do regular enumeration yet, and it might not make as much sense as it does on desktop.

Assignee: nobody → padenot

I'll do it next year, couldn't find time to do it immediately.

Component: General → Audio/Video
Product: GeckoView → Core
Severity: -- → S3
Priority: -- → P3

I'm told by the fluent team that we should hard-code an en-US string for now, and revisit this when bug 1660391 is fixed, since we don't have a JSContext here.

Pushed by
Put an hard-coded but non-empty label for audio devices on Android. r=jib
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

I find that navigator.mediaDevices.enumerateDevices().then(mediaDevices => {console.log(mediaDevices)}) produces blank labels. If I first use getUserMedia to attach a stream to an element, then labels are subsequently returned. Otherwise, labels return blank.

Steps to Reproduce

  1. Create test.html
<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <video id="test"></video>
  1. Run in console: navigator.mediaDevices.enumerateDevices().then(mediaDevices => {console.log(mediaDevices)}) I see no labels.
  2. Run in console navigator.mediaDevices.getUserMedia({video:true}).then(function(stream) { var video = document.getElementById('test'); video.srcObject = stream; }) to attach any video device
  3. Run step 2 again and I see labels.


FF developer 90.0b11 (64-bit) desktop
Windows 10

This is expected. A website shouldn't be able to see the labels of the audio devices attached to the computer of a user, without the user having given consent to the use of these devices, to prevent website authors to fingerprint users.


You need to log in before you can comment on or make changes to this bug.