Media device kinds and counts
Counts of cameras, microphones and speakers, without names, before any permission.
In one line
Can count your cameras, mics, and speakers without names before you allow access
Counts of cameras, microphones and speakers, without names, before any permission.
Tells a site whether the device has a camera and mic and how many outputs. Without permission labels and device IDs are empty, but kinds and counts leak a hardware profile (laptop vs headset vs desktop).
What it can and can't do
What the user does: Nothing. It happens when a page checks for a camera or mic
It can
- See whether you have a camera or microphone
- Count cameras, mics, and speakers
- Guess a laptop, headset, or desktop setup from the counts
- See full device names after you allow camera or mic
It cannot
- See device names or IDs before you allow camera or mic
- Turn on your camera or microphone
- See pictures or sound
- See which device is in use
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 47 | 2015-12-01 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 116 | 2023-08-01 | None |
| Safari | Supported | 11 | 2017-09-19 | None |
| Safari on iPhone | Supported | 11 | 2017-09-19 | None |
| Chrome on Android | Supported | 47 | 2015-12-02 | None |
| Samsung Internet | Supported | 5.0 | 2016-12-15 | None |
How a site asks for it
| API | navigator.mediaDevices.enumerateDevices() |
| Browser compat keys | api.MediaDevices.enumerateDevices |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | read fresh on every page load; nothing stored |
| How to take it back | none needed (no grant) |
| Inside an iframe | Readable from cross-origin iframes too (same values) |
Typical flow
- Page script reads the value
- No prompt is shown
Data you get
Shape: object
How often: static per session
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
kind | enum | None | audioinput, audiooutput, videoinput | Not listed |
count per kind | integer | None | 0 to about 10 | exact |
deviceId, label | string | None | empty until getUserMedia granted | Not listed |
Technical limits
- No labels or hardware IDs until permission
- Safari hides count until permission
The story
What it is
Tells a page how many cameras, microphones and speakers you have, without names, before you give permission.
For you
You never see it. Before you allow anything, a video call page can still tell that you have one camera and two microphones, so it can show the right buttons. It cannot see your name labels yet.
For makers
Video call and recording sites need to know whether to offer camera and microphone options. The counts also say something about your setup, such as a headset or a studio mic. Fingerprinters use it for that reason.
Where you see it
| Type | Example | Apps |
|---|---|---|
| video | A video call page shows a camera button only when it sees a camera, before the permission pop-up. | Google Meet, Zoom |
| games | A browser party game with voice chat shows a mic option only for devices that have one. | None named |
| education | An online class platform checks you have a camera and mic before a live lesson starts. | Google Classroom |
| live | A web streaming studio shows a list of inputs after you press start and offers extras if you have two cameras. | None named |
| health | A telehealth visit checks that you can be seen and heard before the doctor joins. | None named |
| security | A fraud tool sees a device with no audio outputs and treats it as a server or bot. | None named |
| enterprise | An IT help page tests meeting room devices from the browser before a big call. | None named |
Risks
- Hardware clue before permission
- Reveals headsets and studio gear
What the platform says
- MDN: MediaDevices.enumerateDevices. Docs explain it as a way to list device kinds, with names hidden until permission is given.
Good uses and abuse
Legitimate uses
- Hide camera button if none
Known abuse
- Peripheral fingerprint
- Detect headset use
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 2 | Rough identifying entropy, when known |
A real example: LinkedIn
Media devices (cameras, mics, speakers) enumerated. Read by the LinkedIn APFC fingerprint script (48 features, alleged by BrowserGate, partly confirmed by BleepingComputer).
History
- 2017-06, Chrome: Labels blank without permission; deviceId per-origin partitioned
Sources
How well checked: Based on official documentation.