Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions injected/src/features/windows-permission-usage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global Bluetooth, Geolocation, HID, Serial, USB */
/* global Geolocation */
import { DDGProxy, DDGReflect } from '../utils';
import ContentFeature from '../content-feature';

Expand Down Expand Up @@ -383,16 +383,17 @@ export default class WindowsPermissionUsage extends ContentFeature {

// these permissions cannot be disabled using WebView2 or DevTools protocol
const permissionsToDisable = [
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
{ name: 'Bluetooth', prototype: () => Bluetooth.prototype, method: 'requestDevice', isPromise: true },
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
{ name: 'USB', prototype: () => USB.prototype, method: 'requestDevice', isPromise: true },
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
{ name: 'Serial', prototype: () => Serial.prototype, method: 'requestPort', isPromise: true },
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
{ name: 'HID', prototype: () => HID.prototype, method: 'requestDevice', isPromise: true },
{ name: 'Protocol handler', prototype: () => Navigator.prototype, method: 'registerProtocolHandler', isPromise: false },
{ name: 'MIDI', prototype: () => Navigator.prototype, method: 'requestMIDIAccess', isPromise: true },
{ name: 'Bluetooth', prototype: () => globalThis?.Bluetooth?.prototype, method: 'requestDevice', isPromise: true },
{ name: 'USB', prototype: () => globalThis?.USB?.prototype, method: 'requestDevice', isPromise: true },
{ name: 'Serial', prototype: () => globalThis?.Serial?.prototype, method: 'requestPort', isPromise: true },
{ name: 'HID', prototype: () => globalThis?.HID?.prototype, method: 'requestDevice', isPromise: true },
{
name: 'Protocol handler',
prototype: () => globalThis?.Navigator.prototype,
method: 'registerProtocolHandler',
isPromise: false,
},
{ name: 'MIDI', prototype: () => globalThis?.Navigator.prototype, method: 'requestMIDIAccess', isPromise: true },
];
for (const { name, prototype, method, isPromise } of permissionsToDisable) {
try {
Expand Down