mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Refactor patches
This commit is contained in:
parent
7438375356
commit
8c446ceec3
6
dist/better-xcloud.lite.user.js
vendored
6
dist/better-xcloud.lite.user.js
vendored
@ -6192,7 +6192,11 @@ function patchMeControl() {
|
|||||||
window.MSA = new Proxy(MSA, MsaHandler), window.MeControl = new Proxy(MeControl, MeControlHandler);
|
window.MSA = new Proxy(MSA, MsaHandler), window.MeControl = new Proxy(MeControl, MeControlHandler);
|
||||||
}
|
}
|
||||||
function disableAdobeAudienceManager() {
|
function disableAdobeAudienceManager() {
|
||||||
window.adobe = Object.freeze({});
|
Object.defineProperty(window, "adobe", {
|
||||||
|
get() {
|
||||||
|
return Object.freeze({});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function patchCanvasContext() {
|
function patchCanvasContext() {
|
||||||
let nativeGetContext = HTMLCanvasElement.prototype.getContext;
|
let nativeGetContext = HTMLCanvasElement.prototype.getContext;
|
||||||
|
13
dist/better-xcloud.user.js
vendored
13
dist/better-xcloud.user.js
vendored
@ -4068,7 +4068,6 @@ window.dispatchEvent(new GamepadEvent('gamepadconnected', { gamepad }));
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
window.BX_EXPOSED.toggleLocalCoOp = this.toggleLocalCoOp.bind(this);`;
|
window.BX_EXPOSED.toggleLocalCoOp = this.toggleLocalCoOp.bind(this);`;
|
||||||
var set_currently_focused_interactable_default = `e && BxEvent.dispatch(window, BxEvent.NAVIGATION_FOCUS_CHANGED, { element: e });`;
|
|
||||||
var remote_play_enable_default = `connectMode: window.BX_REMOTE_PLAY_CONFIG ? "xhome-connect" : "cloud-connect",
|
var remote_play_enable_default = `connectMode: window.BX_REMOTE_PLAY_CONFIG ? "xhome-connect" : "cloud-connect",
|
||||||
remotePlayServerId: (window.BX_REMOTE_PLAY_CONFIG && window.BX_REMOTE_PLAY_CONFIG.serverId) || '',`;
|
remotePlayServerId: (window.BX_REMOTE_PLAY_CONFIG && window.BX_REMOTE_PLAY_CONFIG.serverId) || '',`;
|
||||||
var remote_play_keep_alive_default = `const msg = JSON.parse(e);
|
var remote_play_keep_alive_default = `const msg = JSON.parse(e);
|
||||||
@ -4246,8 +4245,8 @@ logFunc(logTag, '//', logMessage);
|
|||||||
if (index < 0) return !1;
|
if (index < 0) return !1;
|
||||||
let endIndex = str.indexOf("},", index), newSettings = JSON.stringify(FeatureGates);
|
let endIndex = str.indexOf("},", index), newSettings = JSON.stringify(FeatureGates);
|
||||||
newSettings = newSettings.substring(1, newSettings.length - 1);
|
newSettings = newSettings.substring(1, newSettings.length - 1);
|
||||||
let newCode = newSettings;
|
let newCode = "," + newSettings;
|
||||||
return str = str.substring(0, endIndex) + "," + newCode + str.substring(endIndex), str;
|
return str = PatcherUtils.insertAt(str, endIndex, newCode), str;
|
||||||
},
|
},
|
||||||
disableGamepadDisconnectedScreen(str) {
|
disableGamepadDisconnectedScreen(str) {
|
||||||
let index = str.indexOf('"GamepadDisconnected_Title",');
|
let index = str.indexOf('"GamepadDisconnected_Title",');
|
||||||
@ -4533,7 +4532,7 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
|
|||||||
patchSetCurrentlyFocusedInteractable(str) {
|
patchSetCurrentlyFocusedInteractable(str) {
|
||||||
let index = str.indexOf(".setCurrentlyFocusedInteractable=(");
|
let index = str.indexOf(".setCurrentlyFocusedInteractable=(");
|
||||||
if (index < 0) return !1;
|
if (index < 0) return !1;
|
||||||
return index = str.indexOf("{", index) + 1, str = str.substring(0, index) + set_currently_focused_interactable_default + str.substring(index), str;
|
return index = str.indexOf("{", index) + 1, str = PatcherUtils.insertAt(str, index, "e && BxEvent.dispatch(window, BxEvent.NAVIGATION_FOCUS_CHANGED, { element: e });"), str;
|
||||||
},
|
},
|
||||||
detectProductDetailPage(str) {
|
detectProductDetailPage(str) {
|
||||||
let index = str.indexOf('{location:"ProductDetailPage",');
|
let index = str.indexOf('{location:"ProductDetailPage",');
|
||||||
@ -8538,7 +8537,11 @@ function patchMeControl() {
|
|||||||
window.MSA = new Proxy(MSA, MsaHandler), window.MeControl = new Proxy(MeControl, MeControlHandler);
|
window.MSA = new Proxy(MSA, MsaHandler), window.MeControl = new Proxy(MeControl, MeControlHandler);
|
||||||
}
|
}
|
||||||
function disableAdobeAudienceManager() {
|
function disableAdobeAudienceManager() {
|
||||||
window.adobe = Object.freeze({});
|
Object.defineProperty(window, "adobe", {
|
||||||
|
get() {
|
||||||
|
return Object.freeze({});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function patchCanvasContext() {
|
function patchCanvasContext() {
|
||||||
let nativeGetContext = HTMLCanvasElement.prototype.getContext;
|
let nativeGetContext = HTMLCanvasElement.prototype.getContext;
|
||||||
|
@ -7,7 +7,6 @@ import { BxEvent } from "@/utils/bx-event";
|
|||||||
import codeControllerShortcuts from "./patches/controller-shortcuts.js" with { type: "text" };
|
import codeControllerShortcuts from "./patches/controller-shortcuts.js" with { type: "text" };
|
||||||
import codeExposeStreamSession from "./patches/expose-stream-session.js" with { type: "text" };
|
import codeExposeStreamSession from "./patches/expose-stream-session.js" with { type: "text" };
|
||||||
import codeLocalCoOpEnable from "./patches/local-co-op-enable.js" with { type: "text" };
|
import codeLocalCoOpEnable from "./patches/local-co-op-enable.js" with { type: "text" };
|
||||||
import codeSetCurrentlyFocusedInteractable from "./patches/set-currently-focused-interactable.js" with { type: "text" };
|
|
||||||
import codeRemotePlayEnable from "./patches/remote-play-enable.js" with { type: "text" };
|
import codeRemotePlayEnable from "./patches/remote-play-enable.js" with { type: "text" };
|
||||||
import codeRemotePlayKeepAlive from "./patches/remote-play-keep-alive.js" with { type: "text" };
|
import codeRemotePlayKeepAlive from "./patches/remote-play-keep-alive.js" with { type: "text" };
|
||||||
import codeVibrationAdjust from "./patches/vibration-adjust.js" with { type: "text" };
|
import codeVibrationAdjust from "./patches/vibration-adjust.js" with { type: "text" };
|
||||||
@ -258,9 +257,8 @@ logFunc(logTag, '//', logMessage);
|
|||||||
let newSettings = JSON.stringify(FeatureGates);
|
let newSettings = JSON.stringify(FeatureGates);
|
||||||
newSettings = newSettings.substring(1, newSettings.length - 1);
|
newSettings = newSettings.substring(1, newSettings.length - 1);
|
||||||
|
|
||||||
const newCode = newSettings;
|
const newCode = ',' + newSettings;
|
||||||
|
str = PatcherUtils.insertAt(str, endIndex, newCode);
|
||||||
str = str.substring(0, endIndex) + ',' + newCode + str.substring(endIndex);
|
|
||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -852,7 +850,7 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
index = str.indexOf('{', index) + 1;
|
index = str.indexOf('{', index) + 1;
|
||||||
str = str.substring(0, index) + codeSetCurrentlyFocusedInteractable + str.substring(index);
|
str = PatcherUtils.insertAt(str, index, 'e && BxEvent.dispatch(window, BxEvent.NAVIGATION_FOCUS_CHANGED, { element: e });');
|
||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
e && BxEvent.dispatch(window, BxEvent.NAVIGATION_FOCUS_CHANGED, { element: e });
|
|
Loading…
x
Reference in New Issue
Block a user