Add "disableSendMetadata" patch

This commit is contained in:
redphx 2024-10-22 09:14:11 +07:00
parent 9ab63c4a53
commit 01502363ab
2 changed files with 22 additions and 0 deletions

View File

@ -4383,6 +4383,11 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
let index = str.indexOf('"ContextualCardActions-module__container'); let index = str.indexOf('"ContextualCardActions-module__container');
if (index >= 0 && (index = str.indexOf('addEventListener("touchstart"', index)), index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return ", index, 50)), index < 0) return !1; if (index >= 0 && (index = str.indexOf('addEventListener("touchstart"', index)), index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return ", index, 50)), index < 0) return !1;
return str = PatcherUtils.replaceWith(str, index, "return", "return () => {};"), str; return str = PatcherUtils.replaceWith(str, index, "return", "return () => {};"), str;
},
disableSendMetadata(str) {
let text = "this.sendMetadata(),this.isStreamActive()";
if (!str.includes(text)) return !1;
return str = str.replaceAll(text, "true; return;" + text), str;
} }
}, PATCH_ORDERS = [ }, PATCH_ORDERS = [
...getPref("native_mkb_enabled") === "on" ? [ ...getPref("native_mkb_enabled") === "on" ? [
@ -4438,6 +4443,9 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
"patchStreamHud", "patchStreamHud",
"playVibration", "playVibration",
"alwaysShowStreamHud", "alwaysShowStreamHud",
...getPref("block_tracking") ? [
"disableSendMetadata"
] : [],
getPref("audio_enable_volume_control") && !getPref("stream_combine_sources") && "patchAudioMediaStream", getPref("audio_enable_volume_control") && !getPref("stream_combine_sources") && "patchAudioMediaStream",
getPref("audio_enable_volume_control") && getPref("stream_combine_sources") && "patchCombinedAudioVideoMediaStream", getPref("audio_enable_volume_control") && getPref("stream_combine_sources") && "patchCombinedAudioVideoMediaStream",
getPref("stream_disable_feedback_dialog") && "skipFeedbackDialog", getPref("stream_disable_feedback_dialog") && "skipFeedbackDialog",

View File

@ -971,6 +971,16 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
str = PatcherUtils.replaceWith(str, index, 'return', 'return () => {};'); str = PatcherUtils.replaceWith(str, index, 'return', 'return () => {};');
return str; return str;
}, },
disableSendMetadata(str: string) {
let text = 'this.sendMetadata(),this.isStreamActive()';
if (!str.includes(text)) {
return false;
}
str = str.replaceAll(text, 'true; return;' + text);
return str;
},
}; };
let PATCH_ORDERS: PatchArray = [ let PATCH_ORDERS: PatchArray = [
@ -1046,6 +1056,10 @@ let PLAYING_PATCH_ORDERS: PatchArray = [
'alwaysShowStreamHud', 'alwaysShowStreamHud',
...(getPref(PrefKey.BLOCK_TRACKING) ? [
'disableSendMetadata',
] : []),
// 'exposeEventTarget', // 'exposeEventTarget',
// Patch volume control for normal stream // Patch volume control for normal stream