diff --git a/dist/better-xcloud.user.js b/dist/better-xcloud.user.js index fc93c12..7ab6344 100644 --- a/dist/better-xcloud.user.js +++ b/dist/better-xcloud.user.js @@ -4329,6 +4329,11 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, ".All", index, 150)), index < 0) return !1; if (str = PatcherUtils.replaceWith(str, index, ".All", ".Locked"), index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'), index >= 0 && (index = PatcherUtils.indexOf(str, ".All", index, 250)), index < 0) return !1; return str = PatcherUtils.replaceWith(str, index, ".All", ".Locked"), str; + }, + disableTouchContextMenu(str) { + 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; + return str = PatcherUtils.replaceWith(str, index, "return", "return null;"), str; } }, PATCH_ORDERS = [ ...getPref("native_mkb_enabled") === "on" ? [ @@ -4357,6 +4362,9 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { getPref("ui_hide_sections").includes("all-games") && "ignoreAllGamesSection", getPref("ui_hide_sections").includes("touch") && "ignorePlayWithTouchSection", (getPref("ui_hide_sections").includes("native-mkb") || getPref("ui_hide_sections").includes("most-popular")) && "ignoreSiglSections", + ...STATES.userAgent.capabilities.touch ? [ + "disableTouchContextMenu" + ] : [], ...getPref("block_tracking") ? [ "disableAiTrack", "disableTelemetry", diff --git a/src/modules/patcher.ts b/src/modules/patcher.ts index 647fc11..c8d5911 100644 --- a/src/modules/patcher.ts +++ b/src/modules/patcher.ts @@ -953,7 +953,6 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { return str; }, - /* // Disable long touch activating context menu disableTouchContextMenu(str: string) { let index = str.indexOf('"ContextualCardActions-module__container'); @@ -966,7 +965,6 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { str = PatcherUtils.replaceWith(str, index, 'return', 'return null;'); return str; }, - */ }; let PATCH_ORDERS: PatchArray = [ @@ -1005,6 +1003,10 @@ let PATCH_ORDERS: PatchArray = [ getPref(PrefKey.UI_HIDE_SECTIONS).includes(UiSection.TOUCH) && 'ignorePlayWithTouchSection', (getPref(PrefKey.UI_HIDE_SECTIONS).includes(UiSection.NATIVE_MKB) || getPref(PrefKey.UI_HIDE_SECTIONS).includes(UiSection.MOST_POPULAR)) && 'ignoreSiglSections', + ...(STATES.userAgent.capabilities.touch ? [ + 'disableTouchContextMenu', + ] : []), + ...(getPref(PrefKey.BLOCK_TRACKING) ? [ 'disableAiTrack', 'disableTelemetry',