Compare commits

...

5 Commits

Author SHA1 Message Date
e48b277535 Bump version to 3.1.8 2024-02-15 16:46:56 +07:00
e2dbf873a6 Update translations 2024-02-15 16:46:28 +07:00
6510eac0c3 Fix error while loading profile page 2024-02-15 16:23:06 +07:00
3dd83ace6c Fix mkb's note 2024-02-15 15:49:28 +07:00
45d8aed841 Bump version to 3.1.7 2024-02-15 11:08:02 +07:00
2 changed files with 33 additions and 22 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 3.1.6 // @version 3.1.8
// ==/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 3.1.6 // @version 3.1.8
// @description Improve Xbox Cloud Gaming (xCloud) experience // @description Improve Xbox Cloud Gaming (xCloud) experience
// @author redphx // @author redphx
// @license MIT // @license MIT
@ -14,7 +14,7 @@
// ==/UserScript== // ==/UserScript==
'use strict'; 'use strict';
const SCRIPT_VERSION = '3.1.6'; const SCRIPT_VERSION = '3.1.8';
const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud'; const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud';
const ENABLE_XCLOUD_LOGGER = false; const ENABLE_XCLOUD_LOGGER = false;
@ -1062,10 +1062,10 @@ const Translations = {
"zh-CN": "快速", "zh-CN": "快速",
}, },
"fortnite-allow-stw-mode": { "fortnite-allow-stw-mode": {
"de-DE": "Spielen im \"STW\"-Modus auf Mobilgeräten erlauben", "de-DE": "Erlaubt das Spielen im \"STW\"-Modus auf Mobilgeräten",
"en-US": "Allow playing STW mode on mobile", "en-US": "Allows playing STW mode on mobile",
"es-ES": "Permitir jugar al modo STW en el móvil", "es-ES": "Permitir jugar al modo STW en el móvil",
"ja-JP": "モバイル版で「世界を救え」を許可する", "ja-JP": "モバイル版で「世界を救え」をプレイできるようになります",
"pl-PL": "Zezwól na granie w tryb STW na urządzeniu mobilnym", "pl-PL": "Zezwól na granie w tryb STW na urządzeniu mobilnym",
"pt-BR": "Permitir a reprodução do modo STW no celular", "pt-BR": "Permitir a reprodução do modo STW no celular",
"tr-TR": "Mobil cihazda Fortnite: Dünyayı Kurtar modunu etkinleştir", "tr-TR": "Mobil cihazda Fortnite: Dünyayı Kurtar modunu etkinleştir",
@ -1076,7 +1076,7 @@ const Translations = {
"de-DE": "Fortnite: Erzwinge Konsolenversion", "de-DE": "Fortnite: Erzwinge Konsolenversion",
"en-US": "Fortnite: force console version", "en-US": "Fortnite: force console version",
"es-ES": "Fortnite: forzar versión de consola", "es-ES": "Fortnite: forzar versión de consola",
"ja-JP": "Fortnite: 強制コンソールバージョン", "ja-JP": "Fortnite: 強制的にコンソール版を起動する",
"pl-PL": "Fortnite: wymuś wersję konsolową", "pl-PL": "Fortnite: wymuś wersję konsolową",
"pt-BR": "Fortnite: forçar versão para console", "pt-BR": "Fortnite: forçar versão para console",
"tr-TR": "Fortnite'ın konsol sürümünü aç", "tr-TR": "Fortnite'ın konsol sürümünü aç",
@ -6735,9 +6735,19 @@ class Preferences {
})(), })(),
'ready': () => { 'ready': () => {
const pref = Preferences.SETTINGS[Preferences.MKB_ENABLED]; const pref = Preferences.SETTINGS[Preferences.MKB_ENABLED];
const note = __(pref.unsupported ? 'browser-unsupported-feature' : 'mkb-disclaimer');
let note;
let url;
if (pref.unsupported) {
note = __('browser-unsupported-feature');
url = 'https://github.com/redphx/better-xcloud/issues/206#issuecomment-1920475657';
} else {
note = __('mkb-disclaimer');
url = 'https://better-xcloud.github.io/mouse-and-keyboard/#disclaimer';
}
Preferences.SETTINGS[Preferences.MKB_ENABLED].note = CE('a', { Preferences.SETTINGS[Preferences.MKB_ENABLED].note = CE('a', {
href: 'https://github.com/redphx/better-xcloud/issues/206#issuecomment-1920475657', href: url,
target: '_blank', target: '_blank',
}, '⚠️ ' + note); }, '⚠️ ' + note);
}, },
@ -9041,9 +9051,10 @@ function interceptHttpRequests() {
if (getPref(Preferences.BLOCK_SOCIAL_FEATURES)) { if (getPref(Preferences.BLOCK_SOCIAL_FEATURES)) {
BLOCKED_URLS = BLOCKED_URLS.concat([ BLOCKED_URLS = BLOCKED_URLS.concat([
'https://peoplehub.xboxlive.com/users/me', 'https://peoplehub.xboxlive.com/users/me/people/social',
// 'https://accounts.xboxlive.com/family/memberXuid', 'https://peoplehub.xboxlive.com/users/me/people/recommendations',
'https://notificationinbox.xboxlive.com', 'https://notificationinbox.xboxlive.com',
// 'https://accounts.xboxlive.com/family/memberXuid',
]); ]);
} }
@ -9120,6 +9131,17 @@ function interceptHttpRequests() {
let request = arg[0]; let request = arg[0];
let url = (typeof request === 'string') ? request : request.url; let url = (typeof request === 'string') ? request : request.url;
for (let blocked of BLOCKED_URLS) {
if (!url.startsWith(blocked)) {
continue;
}
return new Response('{"acc":1,"webResult":{}}', {
status: 200,
statusText: '200 OK',
});
}
if (url.endsWith('/play')) { if (url.endsWith('/play')) {
BxEvent.dispatch(window, BxEvent.STREAM_LOADING); BxEvent.dispatch(window, BxEvent.STREAM_LOADING);
} }
@ -9447,17 +9469,6 @@ function interceptHttpRequests() {
}); });
} }
for (let blocked of BLOCKED_URLS) {
if (!url.startsWith(blocked)) {
continue;
}
return new Response('{"acc":1,"webResult":{}}', {
status: 200,
statusText: '200 OK',
});
}
return NATIVE_FETCH(...arg); return NATIVE_FETCH(...arg);
} }
} }