MediaDevices.enumerateDevices() requests Android camera/microphone permissions

RESOLVED DUPLICATE of bug 1450762

Status

defect
RESOLVED DUPLICATE of bug 1450762
Last year
8 months ago

People

(Reporter: Nika, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Posted file example.html
:mhoye noticed that, upon loading certain ads in mobile Firefox, a native Android prompt requesting camera/microphone access for Firefox would pop up. This only occurs if the Firefox app has not previously been granted access to these permissions.

If this prompt is approved, the website does not begin using the microphone or camera, and Firefox does not perform an additional permission prompt.

I believe that this is due to the change in Android's permissions system. Some functionality being hit by these ads causes our camera/microphone system to initialize, causing calls into the OS. These then cause the OS to request permissions on our behalf.

Some testing let me determine that the enumerateDevices() API triggers the behaviour which we were seeing in the ads. Ideally, we shouldn't request these permissions from Android until after the website has been granted permission to use the webcam/microphone.

======

STR:
 1. Disable Camera and Microphone system-level permissions in the settings app for Firefox. (I imagine this will also affect Fenix and other GeckoView-based browsers).
 2. Load the attached testcase in mobile Firefox.

Expected Result:
No permission prompt is displayed, and the page displays a series of deviceIds.

Actual Result:
A system-level permissions prompt appears requesting camera & microphone access.
Attachment #9005720 - Attachment mime type: text/plain → text/html
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → DUPLICATE
Duplicate of bug: 1450762
Product: Firefox for Android → GeckoView
You need to log in before you can comment on or make changes to this bug.