Remove BYOG feature flag and related code

This commit is contained in:
redphx
2025-08-30 17:19:26 +07:00
parent c199351515
commit d8f31f4ab4
8 changed files with 23 additions and 33 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -138,7 +138,6 @@ export const enum StreamVideoProcessingMode {
export const enum BlockFeature {
CHAT = 'chat',
FRIENDS = 'friends',
BYOG = 'byog',
NOTIFICATIONS_INVITES = 'notifications-invites',
NOTIFICATIONS_ACHIEVEMENTS = 'notifications-achievements',
REMOTE_PLAY = 'remote-play',

View File

@@ -768,14 +768,13 @@ true` + text;
},
ignoreByogSection(str: string) {
let index = str.indexOf('"ByogRow-module__container');
index > -1 && (index = PatcherUtils.lastIndexOf(str, 'return', index, 100));
let index = str.indexOf('"ShowcaseRow-module__container');
index > -1 && (index = PatcherUtils.lastIndexOf(str, ')=>(', index, 200));
if (index < 0) {
return false;
}
str = PatcherUtils.insertAt(str, index, 'return null;');
str = PatcherUtils.insertAt(str, index + 3, 'null && ');
return str;
},
@@ -1357,7 +1356,7 @@ let PATCH_ORDERS = PatcherUtils.filterPatches([
const hideSections = getGlobalPref(GlobalPref.UI_HIDE_SECTIONS);
let HOME_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([
hideSections.includes(UiSection.GENRES) && 'ignoreGenresSection',
!getGlobalPref(GlobalPref.BLOCK_FEATURES).includes(BlockFeature.BYOG) && hideSections.includes(UiSection.BOYG) && 'ignoreByogSection',
hideSections.includes(UiSection.BOYG) && 'ignoreByogSection',
STATES.browser.capabilities.touch && hideSections.includes(UiSection.TOUCH) && 'ignorePlayWithTouchSection',

View File

@@ -25,8 +25,8 @@ export function addCss() {
}
// Hide BYOG section
if (getGlobalPref(GlobalPref.BLOCK_FEATURES).includes(BlockFeature.BYOG) || getGlobalPref(GlobalPref.UI_HIDE_SECTIONS).includes(UiSection.BOYG)) {
selectorToHide.push('#BodyContent > div[class*=ByogRow-module__container___]');
if (getGlobalPref(GlobalPref.UI_HIDE_SECTIONS).includes(UiSection.BOYG)) {
selectorToHide.push('#BodyContent > div[class*=ShowcaseRow-module__container___]');
}
// Hide "All games" section

View File

@@ -30,12 +30,6 @@ if (blockFeatures.includes(BlockFeature.FRIENDS)) {
FeatureGates.EnableFriendsAndFollowers = false;
}
// Disable BYOG feature
if (blockFeatures.includes(BlockFeature.BYOG)) {
FeatureGates.EnableBYOG = false;
FeatureGates.EnableBYOGPurchase = false;
}
if (BX_FLAGS.FeatureGates) {
FeatureGates = Object.assign(BX_FLAGS.FeatureGates, FeatureGates);
}

View File

@@ -208,6 +208,7 @@ export function interceptHttpRequests() {
'2c06dea3f26c40c69b8456d319791fd0@o427368.ingest.sentry.io',
];
// @ts-expect-error
window.BX_FETCH = window.fetch = async (request: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
let url = (typeof request === 'string') ? request : (request as Request).url;
@@ -259,7 +260,7 @@ export function interceptHttpRequests() {
const response = await NATIVE_FETCH(request, init);
const obj = await response.clone().json();
if (url.includes(GamePassCloudGallery.ALL) || url.includes(GamePassCloudGallery.ALL_WITH_BYGO)) {
if (url.includes(GamePassCloudGallery.ALL) || url.includes(GamePassCloudGallery.ALL_WITH_BYOG)) {
for (let i = 1; i < obj.length; i++) {
gamepassAllGames.push(obj[i].id);
}

View File

@@ -493,7 +493,6 @@ export class GlobalSettingsStorage extends BaseSettingsStorage<GlobalPref> {
multipleOptions: {
[BlockFeature.CHAT]: t('chat'),
[BlockFeature.FRIENDS]: t('friends-followers'),
[BlockFeature.BYOG]: t('stream-your-own-game'),
[BlockFeature.NOTIFICATIONS_INVITES]: t('notifications') + ': ' + t('invites'),
[BlockFeature.NOTIFICATIONS_ACHIEVEMENTS]: t('notifications') + ': ' + t('achievements'),
[BlockFeature.REMOTE_PLAY]: t('remote-play'),