mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 15:47:18 +02:00
Update better-xcloud.user.js
This commit is contained in:
parent
eebd7434ea
commit
a4a52c6bc3
87
dist/better-xcloud.user.js
vendored
87
dist/better-xcloud.user.js
vendored
@ -6235,7 +6235,6 @@ class RemotePlayNavigationDialog extends NavigationDialog {
|
|||||||
url: "https://better-xcloud.github.io/remote-play",
|
url: "https://better-xcloud.github.io/remote-play",
|
||||||
label: t("help")
|
label: t("help")
|
||||||
}), createButton({
|
}), createButton({
|
||||||
icon: BxIcon.CLOSE,
|
|
||||||
style: 4 | 32,
|
style: 4 | 32,
|
||||||
label: t("close")
|
label: t("close")
|
||||||
}))), this.$container = $fragment;
|
}))), this.$container = $fragment;
|
||||||
@ -6265,46 +6264,6 @@ class RemotePlayManager {
|
|||||||
XHOME_TOKEN;
|
XHOME_TOKEN;
|
||||||
consoles;
|
consoles;
|
||||||
regions = [];
|
regions = [];
|
||||||
static BASE_DEVICE_INFO = {
|
|
||||||
appInfo: {
|
|
||||||
env: {
|
|
||||||
clientAppId: window.location.host,
|
|
||||||
clientAppType: "browser",
|
|
||||||
clientAppVersion: "24.17.36",
|
|
||||||
clientSdkVersion: "10.1.14",
|
|
||||||
httpEnvironment: "prod",
|
|
||||||
sdkInstallId: ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dev: {
|
|
||||||
displayInfo: {
|
|
||||||
dimensions: {
|
|
||||||
widthInPixels: 1920,
|
|
||||||
heightInPixels: 1080
|
|
||||||
},
|
|
||||||
pixelDensity: {
|
|
||||||
dpiX: 1,
|
|
||||||
dpiY: 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
hw: {
|
|
||||||
make: "Microsoft",
|
|
||||||
model: "unknown",
|
|
||||||
sdktype: "web"
|
|
||||||
},
|
|
||||||
os: {
|
|
||||||
name: "windows",
|
|
||||||
ver: "22631.2715",
|
|
||||||
platform: "desktop"
|
|
||||||
},
|
|
||||||
browser: {
|
|
||||||
browserName: "chrome",
|
|
||||||
browserVersion: "125.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
constructor() {
|
|
||||||
}
|
|
||||||
initialize() {
|
initialize() {
|
||||||
if (this.isInitialized)
|
if (this.isInitialized)
|
||||||
return;
|
return;
|
||||||
@ -6374,17 +6333,15 @@ class RemotePlayManager {
|
|||||||
Authorization: `Bearer ${this.XHOME_TOKEN}`
|
Authorization: `Bearer ${this.XHOME_TOKEN}`
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
for (let region2 of this.regions) {
|
for (let region2 of this.regions)
|
||||||
try {
|
try {
|
||||||
const request = new Request(`${region2.baseUri}/v6/servers/home?mr=50`, options), json = await (await fetch(request)).json();
|
const request = new Request(`${region2.baseUri}/v6/servers/home?mr=50`, options), json = await (await fetch(request)).json();
|
||||||
if (json.results.length === 0)
|
if (json.results.length === 0)
|
||||||
continue;
|
continue;
|
||||||
this.consoles = json.results, STATES.remotePlay.server = region2.baseUri;
|
this.consoles = json.results, STATES.remotePlay.server = region2.baseUri;
|
||||||
|
break;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
if (this.consoles)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!STATES.remotePlay.server)
|
if (!STATES.remotePlay.server)
|
||||||
this.consoles = [];
|
this.consoles = [];
|
||||||
callback();
|
callback();
|
||||||
@ -6426,6 +6383,44 @@ class RemotePlayManager {
|
|||||||
|
|
||||||
class XhomeInterceptor {
|
class XhomeInterceptor {
|
||||||
static #consoleAddrs = {};
|
static #consoleAddrs = {};
|
||||||
|
static BASE_DEVICE_INFO = {
|
||||||
|
appInfo: {
|
||||||
|
env: {
|
||||||
|
clientAppId: window.location.host,
|
||||||
|
clientAppType: "browser",
|
||||||
|
clientAppVersion: "24.17.36",
|
||||||
|
clientSdkVersion: "10.1.14",
|
||||||
|
httpEnvironment: "prod",
|
||||||
|
sdkInstallId: ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dev: {
|
||||||
|
displayInfo: {
|
||||||
|
dimensions: {
|
||||||
|
widthInPixels: 1920,
|
||||||
|
heightInPixels: 1080
|
||||||
|
},
|
||||||
|
pixelDensity: {
|
||||||
|
dpiX: 1,
|
||||||
|
dpiY: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hw: {
|
||||||
|
make: "Microsoft",
|
||||||
|
model: "unknown",
|
||||||
|
sdktype: "web"
|
||||||
|
},
|
||||||
|
os: {
|
||||||
|
name: "windows",
|
||||||
|
ver: "22631.2715",
|
||||||
|
platform: "desktop"
|
||||||
|
},
|
||||||
|
browser: {
|
||||||
|
browserName: "chrome",
|
||||||
|
browserVersion: "125.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
static async#handleLogin(request) {
|
static async#handleLogin(request) {
|
||||||
try {
|
try {
|
||||||
const obj = await request.clone().json();
|
const obj = await request.clone().json();
|
||||||
@ -6500,7 +6495,7 @@ class XhomeInterceptor {
|
|||||||
for (let pair of clone.headers.entries())
|
for (let pair of clone.headers.entries())
|
||||||
headers[pair[0]] = pair[1];
|
headers[pair[0]] = pair[1];
|
||||||
headers.authorization = `Bearer ${RemotePlayManager.getInstance().xhomeToken}`;
|
headers.authorization = `Bearer ${RemotePlayManager.getInstance().xhomeToken}`;
|
||||||
const deviceInfo = RemotePlayManager.BASE_DEVICE_INFO;
|
const deviceInfo = XhomeInterceptor.BASE_DEVICE_INFO;
|
||||||
if (getPref("xhome_resolution") === "720p")
|
if (getPref("xhome_resolution") === "720p")
|
||||||
deviceInfo.dev.os.name = "android";
|
deviceInfo.dev.os.name = "android";
|
||||||
headers["x-ms-device-info"] = JSON.stringify(deviceInfo);
|
headers["x-ms-device-info"] = JSON.stringify(deviceInfo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user