Fix error while loading profile page

This commit is contained in:
redphx
2024-02-15 16:23:06 +07:00
parent 3dd83ace6c
commit 6510eac0c3

View File

@@ -9051,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',
]); ]);
} }
@@ -9130,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);
} }
@@ -9457,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);
} }
} }