Skip to content

Commit cb58ba7

Browse files
Remove disableDeviceEnumeration feature as no longer used (#1964)
1 parent e612930 commit cb58ba7

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

injected/src/features/web-compat.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ export class WebCompat extends ContentFeature {
138138
if (this.getFeatureSettingEnabled('modifyCookies')) {
139139
this.modifyCookies();
140140
}
141-
if (this.getFeatureSettingEnabled('disableDeviceEnumeration')) {
142-
this.preventDeviceEnumeration();
143-
}
144141
if (this.getFeatureSettingEnabled('enumerateDevices')) {
145142
this.deviceEnumerationFix();
146143
}
@@ -806,33 +803,6 @@ export class WebCompat extends ContentFeature {
806803
}
807804
}
808805

809-
/**
810-
* Prevents device enumeration by returning an empty array when enabled
811-
*/
812-
preventDeviceEnumeration() {
813-
if (!window.MediaDevices) {
814-
return;
815-
}
816-
let disableDeviceEnumeration = false;
817-
const isFrame = window.self !== window.top;
818-
if (isFrame) {
819-
disableDeviceEnumeration = this.getFeatureSettingEnabled('disableDeviceEnumerationFrames');
820-
} else {
821-
disableDeviceEnumeration = this.getFeatureSettingEnabled('disableDeviceEnumeration');
822-
}
823-
if (disableDeviceEnumeration) {
824-
const enumerateDevicesProxy = new DDGProxy(this, MediaDevices.prototype, 'enumerateDevices', {
825-
/**
826-
* @returns {Promise<MediaDeviceInfo[]>}
827-
*/
828-
apply() {
829-
return Promise.resolve([]);
830-
},
831-
});
832-
enumerateDevicesProxy.overload();
833-
}
834-
}
835-
836806
/**
837807
* Creates a valid MediaDeviceInfo or InputDeviceInfo object that passes instanceof checks
838808
* @param {'videoinput' | 'audioinput' | 'audiooutput'} kind - The device kind

0 commit comments

Comments
 (0)