mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Disable telemetry flags in meversion.js
This commit is contained in:
parent
4231d7e9c6
commit
8fb1787222
@ -23,7 +23,7 @@ import { RemotePlay } from "@modules/remote-play";
|
||||
import { onHistoryChanged, patchHistoryMethod } from "@utils/history";
|
||||
import { VibrationManager } from "@modules/vibration-manager";
|
||||
import { PreloadedState } from "@utils/titles-info";
|
||||
import { patchAudioContext, patchRtcCodecs, patchRtcPeerConnection, patchVideoApi } from "@utils/monkey-patches";
|
||||
import { patchAudioContext, patchMeControl, patchRtcCodecs, patchRtcPeerConnection, patchVideoApi } from "@utils/monkey-patches";
|
||||
import { STATES } from "@utils/global";
|
||||
import { injectStreamMenuButtons } from "@modules/stream/stream-ui";
|
||||
import { BxLogger } from "@utils/bx-logger";
|
||||
@ -216,9 +216,8 @@ function main() {
|
||||
interceptHttpRequests();
|
||||
patchVideoApi();
|
||||
|
||||
if (getPref(PrefKey.AUDIO_ENABLE_VOLUME_CONTROL)) {
|
||||
patchAudioContext();
|
||||
}
|
||||
getPref(PrefKey.AUDIO_ENABLE_VOLUME_CONTROL) && patchAudioContext();
|
||||
getPref(PrefKey.BLOCK_TRACKING) && patchMeControl();
|
||||
|
||||
PreloadedState.override();
|
||||
|
||||
|
@ -130,3 +130,53 @@ export function patchAudioContext() {
|
||||
return ctx;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable telemetry flags in meversion.js
|
||||
*/
|
||||
export function patchMeControl() {
|
||||
const overrideConfigs = {
|
||||
enableAADTelemetry: false,
|
||||
enableTelemetry: false,
|
||||
telEvs: '',
|
||||
oneDSUrl: '',
|
||||
};
|
||||
|
||||
const MSA = {
|
||||
MeControl: {},
|
||||
};
|
||||
const MeControl = {};
|
||||
|
||||
const MsaHandler: ProxyHandler<any> = {
|
||||
get(target, prop, receiver) {
|
||||
return target[prop];
|
||||
},
|
||||
|
||||
set(obj, prop, value) {
|
||||
if (prop === 'MeControl' && value.Config) {
|
||||
value.Config = Object.assign(value.Config, overrideConfigs);
|
||||
}
|
||||
|
||||
obj[prop] = value;
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
||||
const MeControlHandler: ProxyHandler<any> = {
|
||||
get(target, prop, receiver) {
|
||||
return target[prop];
|
||||
},
|
||||
|
||||
set(obj, prop, value) {
|
||||
if (prop === 'Config') {
|
||||
value = Object.assign(value, overrideConfigs);
|
||||
}
|
||||
|
||||
obj[prop] = value;
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
||||
(window as any).MSA = new Proxy(MSA, MsaHandler);
|
||||
(window as any).MeControl = new Proxy(MeControl, MeControlHandler);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user