Closed Bug 1681772 Opened 3 years ago Closed 3 years ago

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

Categories

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

Unspecified
All
defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: amejia, Assigned: padenot)

Details

Attachments

(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)
      console.log(device);
  });
});
  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 padenot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eb7671c9034a
Put an hard-coded but non-empty label for audio devices on Android. r=jib
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Flags: qe-verify+

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>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
        <video id="test"></video>
</body>
</html>
  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.

Version/Device

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.

Reference: https://w3c.github.io/mediacapture-main/getusermedia.html#device-information-can-be-exposed

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

Attachment

General

Created:
Updated:
Size: