mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00
Add "ignoreNewsSection" patch
This commit is contained in:
parent
1d8517a997
commit
f8b8012f5c
6
dist/better-xcloud.user.js
vendored
6
dist/better-xcloud.user.js
vendored
@ -4525,6 +4525,11 @@ true` + text;
|
||||
if (index = str.indexOf(`const ${funcName}=e=>{`), index > -1 && (index = str.indexOf("return ", index)), index > -1 && (index = str.indexOf("?", index)), index < 0) return !1;
|
||||
return str = str.substring(0, index) + "|| true" + str.substring(index), str;
|
||||
},
|
||||
ignoreNewsSection(str) {
|
||||
let index = str.indexOf('Logger("CarouselRow")');
|
||||
if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "const ", index, 200)), index < 0) return !1;
|
||||
return str = PatcherUtils.insertAt(str, index, "return null;"), str;
|
||||
},
|
||||
ignorePlayWithFriendsSection(str) {
|
||||
let index = str.indexOf('location:"PlayWithFriendsRow",');
|
||||
if (index < 0) return !1;
|
||||
@ -4705,6 +4710,7 @@ ${subsVar} = subs;
|
||||
"changeNotificationsSubscription"
|
||||
] : []
|
||||
]), hideSections = getPref("ui.hideSections"), HOME_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([
|
||||
hideSections.includes("news") && "ignoreNewsSection",
|
||||
hideSections.includes("friends") && "ignorePlayWithFriendsSection",
|
||||
hideSections.includes("all-games") && "ignoreAllGamesSection",
|
||||
STATES.browser.capabilities.touch && hideSections.includes("touch") && "ignorePlayWithTouchSection",
|
||||
|
@ -694,6 +694,18 @@ true` + text;
|
||||
return str;
|
||||
},
|
||||
|
||||
// Don't render News section
|
||||
ignoreNewsSection(str: string) {
|
||||
let index = str.indexOf('Logger("CarouselRow")');
|
||||
index > -1 && (index = PatcherUtils.lastIndexOf(str, 'const ', index, 200));
|
||||
if (index < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
str = PatcherUtils.insertAt(str, index, 'return null;');
|
||||
return str;
|
||||
},
|
||||
|
||||
// Don't render "Play With Friends" sections
|
||||
ignorePlayWithFriendsSection(str: string) {
|
||||
let index = str.indexOf('location:"PlayWithFriendsRow",');
|
||||
@ -1045,6 +1057,7 @@ let PATCH_ORDERS = PatcherUtils.filterPatches([
|
||||
|
||||
const hideSections = getPref<UiSection[]>(PrefKey.UI_HIDE_SECTIONS);
|
||||
let HOME_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([
|
||||
hideSections.includes(UiSection.NEWS) && 'ignoreNewsSection',
|
||||
hideSections.includes(UiSection.FRIENDS) && 'ignorePlayWithFriendsSection',
|
||||
hideSections.includes(UiSection.ALL_GAMES) && 'ignoreAllGamesSection',
|
||||
STATES.browser.capabilities.touch && hideSections.includes(UiSection.TOUCH) && 'ignorePlayWithTouchSection',
|
||||
|
Loading…
x
Reference in New Issue
Block a user