Media Devices Privacy
Control how
navigator.mediaDevices.enumerateDevices()reports audio and video devices with--bot-config-media-devices.
Prerequisites
- BotBrowser installed. See Installation Guide.
- A profile file (
.encfor production).
Overview
navigator.mediaDevices.enumerateDevices() returns a list of available audio and video input/output devices. The number, names, and IDs of these devices vary by system and can be used as a fingerprint signal. BotBrowser controls the device list to return consistent results regardless of the host machine’s actual hardware.
Quick Start
# Default: use profile-defined device list (recommended)
chromium-browser \
--bot-profile="/path/to/profile.enc" \
--user-data-dir="$(mktemp -d)"By default, BotBrowser returns the profile’s device list. No extra flags needed.
Configuration
The --bot-config-media-devices flag controls device enumeration:
| Value | Behavior |
|---|---|
profile (default) | Return profile-defined devices. The device list matches the target platform regardless of host hardware. |
real | Use the host system’s actual devices. Useful for development or when you need real audio/video capture. |
# Use profile devices (default)
chromium-browser \
--bot-profile="/path/to/profile.enc" \
--bot-config-media-devices=profile
# Use host system devices
chromium-browser \
--bot-profile="/path/to/profile.enc" \
--bot-config-media-devices=realCommon Scenarios
Consistent device count across servers
Different servers have different audio hardware (or none). With profile mode, every instance reports the same device list:
const browser = await chromium.launch({
executablePath: process.env.BOTBROWSER_EXEC_PATH,
headless: true,
args: [
"--bot-profile=/path/to/profile.enc",
],
});
const page = await browser.newPage();
const devices = await page.evaluate(async () => {
const list = await navigator.mediaDevices.enumerateDevices();
return list.map(d => ({ kind: d.kind, label: d.label }));
});
console.log(devices); // Same list on any host
await browser.close();Development with real devices
When testing audio/video capture locally, use real mode:
chromium-browser \
--bot-profile="/path/to/profile.enc" \
--bot-config-media-devices=real \
--user-data-dir="$(mktemp -d)"Troubleshooting / FAQ
| Problem | Solution |
|---|---|
| Empty device list | Ensure the profile contains media device data. Most standard profiles include default device entries. |
| Need real microphone access | Set --bot-config-media-devices=real to expose host hardware. |
| Device IDs change between sessions | Device IDs are derived from the profile. Use the same profile for consistent IDs across sessions. |
Next Steps
- Audio Fingerprint Protection. Control audio rendering and noise.
- Navigator Properties. Other navigator-level fingerprint surfaces.
- CLI Flags Reference. Complete flag documentation.
Related documentation: CLI Flags | Profile Configuration
Legal Disclaimer & Terms of Use • Responsible Use Guidelines . BotBrowser is for authorized fingerprint protection and privacy research only.