JavaScript Restrictor
Browser extension that improves privacy and security
wrappingS-MCS.js File Reference

Wrappers for Media Capture and Streams standard. More...

Detailed Description

Wrappers for Media Capture and Streams standard.

See also
https://www.w3.org/TR/mediacapture-streams/
Author
Copyright (C) 2021 Libor Polcak
Copyright (C) 2021 Matus Svancar
License:
SPDX-License-Identifier: GPL-3.0-or-later
License:
SPDX-License-Identifier: MPL-2.0

This file contains wrapper for MediaDevices.enumerateDevices https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices

The goal is to prevent fingerprinting by modifying return value of enumerateDevices.

This wrapper operates with three levels of protection:

  • (0) - return promise with suffled array
  • (1) - return promise with shuffled array with additional 0-4 fake devices
  • (2) - return empty promise

Shuffling approach is inspired by the algorithms created by Brave Software https://brave.com available at https://github.com/brave/brave-core/blob/master/chromium_src/third_party/blink/renderer/modules/mediastream/media_devices.cc