Compare commits

...

3 Commits

Author SHA1 Message Date
f3b9ebdb22 Bump version to 2.0.5 2023-12-08 07:43:30 +07:00
abd1aae57a Add "enableConsoleLogging" patch 2023-12-08 07:35:45 +07:00
ccdb944b99 Fix the Settings button not showing for some users 2023-12-08 07:23:44 +07:00
2 changed files with 21 additions and 7 deletions

View File

@ -1,5 +1,5 @@
// ==UserScript== // ==UserScript==
// @name Better xCloud // @name Better xCloud
// @namespace https://github.com/redphx // @namespace https://github.com/redphx
// @version 2.0.4 // @version 2.0.5
// ==/UserScript== // ==/UserScript==

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Better xCloud // @name Better xCloud
// @namespace https://github.com/redphx // @namespace https://github.com/redphx
// @version 2.0.4 // @version 2.0.5
// @description Improve Xbox Cloud Gaming (xCloud) experience // @description Improve Xbox Cloud Gaming (xCloud) experience
// @author redphx // @author redphx
// @license MIT // @license MIT
@ -13,7 +13,7 @@
// ==/UserScript== // ==/UserScript==
'use strict'; 'use strict';
const SCRIPT_VERSION = '2.0.4'; const SCRIPT_VERSION = '2.0.5';
const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud'; const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud';
const ENABLE_MKB = false; const ENABLE_MKB = false;
@ -4354,12 +4354,22 @@ class Patcher {
}, },
enableXcloudLogger: ENABLE_XCLOUD_LOGGER && function(funcStr) { enableXcloudLogger: ENABLE_XCLOUD_LOGGER && function(funcStr) {
const text = 'if(t!==Ke.LogLevel.Error&&t!==Ke.LogLevel.Warn)'; const text = '}log(e,t,n){';
if (!funcStr.includes(text)) { if (!funcStr.includes(text)) {
return false; return false;
} }
funcStr = funcStr.replaceAll(text, 'console.log(arguments);' + text); funcStr = funcStr.replaceAll(text, text + 'console.log(arguments);');
return funcStr;
},
enableConsoleLogging: ENABLE_XCLOUD_LOGGER && function(funcStr) {
const text = 'static isConsoleLoggingAllowed(){';
if (!funcStr.includes(text)) {
return false;
}
funcStr = funcStr.replaceAll(text, text + 'return true;');
return funcStr; return funcStr;
}, },
@ -4386,16 +4396,20 @@ class Patcher {
['tvLayout'], ['tvLayout'],
['enableXcloudLogger'],
[ [
'enableMouseAndKeyboard', 'enableMouseAndKeyboard',
'enableXcloudLogger',
'remotePlayDirectConnectUrl', 'remotePlayDirectConnectUrl',
'disableTrackEvent', 'disableTrackEvent',
'enableConsoleLogging',
'remotePlayKeepAlive', 'remotePlayKeepAlive',
'blockWebRtcStatsCollector', 'blockWebRtcStatsCollector',
], ],
// Only when playing
['remotePlayConnectMode'], ['remotePlayConnectMode'],
['enableConsoleLogging'],
]; ];
static #patchFunctionBind() { static #patchFunctionBind() {
@ -5764,7 +5778,7 @@ function interceptHttpRequests() {
} }
// Start rendering UI // Start rendering UI
if (!document.getElementById('gamepass-root')) { if (document.querySelector('div[class^=UnsupportedMarketPage]')) {
setTimeout(watchHeader, 2000); setTimeout(watchHeader, 2000);
} else { } else {
watchHeader(); watchHeader();