diff --git a/LCUdebloater.js b/LCUdebloater.js
index 5502e77..a14fd83 100644
--- a/LCUdebloater.js
+++ b/LCUdebloater.js
@@ -14,7 +14,7 @@
suppressConsoleMethods();
window.onerror = function(message, source, lineno, colno, error) {
- return true;
+ return true;
};
window.onunhandledrejection = function(event) {
@@ -22,6 +22,23 @@
};
})();
+(function() {
+ const originalXHROpen = XMLHttpRequest.prototype.open;
+
+ XMLHttpRequest.prototype.open = function(method, url, async, user, password) {
+ const blockedUrls = [
+ '/lol-login/v1/session',
+ '/lol-league-session/v1/league-session-token'
+ ];
+
+ if (method === 'DELETE' && blockedUrls.some(blockedUrl => url.includes(blockedUrl))) {
+ return;
+ }
+
+ return originalXHROpen.apply(this, arguments);
+ };
+})();
+
(function blockApis() {
const originalXHROpen = XMLHttpRequest.prototype.open;
const blockedUrls = [
@@ -81,7 +98,7 @@
return;
}
- if (url === "/lol-settings/v2/config" || url === "/lol-premade-voice/v1/first-experience" || url === "/lol-platform-config/v1/namespaces/LcuChampionSelect/PickOrderSwappingTooltipEnabled" || url === "/lol-platform-config/v1/namespaces/LcuChampionSelect/ChampTradingTooltipEnabled" ||url === "/lol-settings/v1/account/lol-parties" || url === "/lol-lobby/v1/autofill-displayed" || url === "/lol-perks/v1/show-auto-modified-pages-notification" || url === "/lol-platform-config/v1/namespaces/LeagueConfig/RankedReferenceModalEnabled" || url === "/lol-lobby-team-builder/champ-select/v1/has-auto-assigned-smite" || url === "/lol-platform-config/v1/namespaces/LeagueConfig" || url === "/lol-client-config/v3/client-config/lol.client_settings.sentry_config") {
+ if (url === "/lol-settings/v2/config" || url === "/lol-premade-voice/v1/first-experience" || url === "/lol-platform-config/v1/namespaces/LcuChampionSelect/PickOrderSwappingTooltipEnabled" || url === "/lol-platform-config/v1/namespaces/LcuChampionSelect/ChampTradingTooltipEnabled" || url === "/lol-settings/v1/account/lol-parties" || url === "/lol-lobby/v1/autofill-displayed" || url === "/lol-perks/v1/show-auto-modified-pages-notification" || url === "/lol-platform-config/v1/namespaces/LeagueConfig/RankedReferenceModalEnabled" || url === "/lol-lobby-team-builder/champ-select/v1/has-auto-assigned-smite" || url === "/lol-platform-config/v1/namespaces/LeagueConfig" || url === "/lol-client-config/v3/client-config/lol.client_settings.sentry_config" || url === "/lol-client-config/v3/client-config/lol.client_settings.datadog_rum_config" || url === "/lol-client-config/v3/client-config/lol.client_settings.client_navigability.info_hub_disabled") {
const originalSend = this.send;
this.send = function(body) {
let originalOnReadyStateChange = this.onreadystatechange;
@@ -101,7 +118,7 @@
isTermsEnabled: false,
localizedLicensesURL: ""
});
- } else if (url === "/lol-lobby/v1/autofill-displayed") {
+ } else if (url === "/lol-lobby/v1/autofill-displayed" || url === "/lol-client-config/v3/client-config/lol.client_settings.client_navigability.info_hub_disabled") {
content = JSON.stringify(true);
} else if (url === "/lol-platform-config/v1/namespaces/LcuChampionSelect/PickOrderSwappingTooltipEnabled" || url === "/lol-platform-config/v1/namespaces/LcuChampionSelect/ChampTradingTooltipEnabled" || url === "/lol-perks/v1/show-auto-modified-pages-notification" || url === "/lol-platform-config/v1/namespaces/LeagueConfig/RankedReferenceModalEnabled" || url === "/lol-lobby-team-builder/champ-select/v1/has-auto-assigned-smite") {
content = JSON.stringify(false);
@@ -123,12 +140,27 @@
showFirstExperienceInGame: false,
showFirstExperienceInLCU: false
});
- } else if (url === "/lol-client-config/v3/client-config/lol.client_settings.sentry_config") {
+ } else if (url === "/lol-client-config/v3/client-config/lol.client_settings.sentry_config") {
content = JSON.stringify({
dsn: "",
- isEnabled: false,
+ isEnabled: false,
sampleRate: 0
});
+ } else if (url === "/lol-client-config/v3/client-config/lol.client_settings.datadog_rum_config") {
+ content = JSON.stringify({
+ applicationID: "",
+ clientToken: "",
+ isEnabled: false,
+ service: "",
+ sessionReplaySampleRate: 0,
+ sessionSampleRate: 0,
+ site: "",
+ telemetrySampleRate: 0,
+ traceSampleRate: 0,
+ trackLongTasks: false,
+ trackResources: false,
+ trackUserInteractions: false
+ });
}
Object.defineProperty(this, 'responseText', {
@@ -187,14 +219,14 @@
childList: true,
subtree: true
});
- hideElement();
+ hideElement();
const greyoutObserver = new MutationObserver(greyout);
greyoutObserver.observe(body, {
childList: true,
subtree: true
});
- greyout();
+ greyout();
} else {
console.error('Document body is not available.');
}
@@ -207,25 +239,28 @@
const firstGeneralRow = document.querySelector('.lol-settings-general-row, .lol-settings-notifications-row');
if (firstGeneralRow && !document.querySelector('.admin-warning-box')) {
- var adminBox = document.createElement('div');
- adminBox.classList.add('admin-warning-box');
- adminBox.style.backgroundColor = '#1e2328';
- adminBox.style.color = '#f0e6d2';
- adminBox.style.padding = '6px';
- adminBox.style.marginBottom = '10px';
- adminBox.style.borderRadius = '0';
- adminBox.style.borderLeft = '3.5px solid #c89b3c';
- adminBox.style.fontWeight = 'bold';
- adminBox.style.fontSize = '14px';
- adminBox.style.fontFamily = 'LoL Display, Arial';
- adminBox.textContent = "Some of these settings are enforced by League Client Debloater";
+ var adminBox = document.createElement('div');
+ adminBox.classList.add('admin-warning-box');
+ adminBox.style.backgroundColor = '#1e2328';
+ adminBox.style.color = '#f0e6d2';
+ adminBox.style.padding = '6px';
+ adminBox.style.marginBottom = '10px';
+ adminBox.style.borderRadius = '0';
+ adminBox.style.borderLeft = '3.5px solid #c89b3c';
+ adminBox.style.fontWeight = 'bold';
+ adminBox.style.fontSize = '14px';
+ adminBox.style.fontFamily = 'LoL Display, Arial';
+ adminBox.textContent = "Some of these settings are enforced by League Client Debloater";
firstGeneralRow.parentNode.insertBefore(adminBox, firstGeneralRow);
}
});
if (document.body) {
- observer.observe(document.body, { childList: true, subtree: true });
+ observer.observe(document.body, {
+ childList: true,
+ subtree: true
+ });
} else {
console.error("Document body is not available for MutationObserver.");
}
@@ -237,7 +272,7 @@
(function forceSettings() {
window.addEventListener('load', function() {
-
+
const lcuPreferencesPayload = {
"data": {
"top-nav-updates-eat-seen": true,
@@ -258,9 +293,9 @@
"data": {
"hasBeenPromptedForPotatoMode": true,
"lastKnownMachineSpec": 3,
- "motionEffectsDisabled": true,
+ "motionEffectsDisabled": true,
"potatoModeEnabled": true,
- "unloadLeagueClientUx": "never"
+ "closeLeagueClientDuringGame": false,
},
"schemaVersion": 3
};
@@ -310,19 +345,24 @@
}, false);
})();
-import { jsx, render } from 'https://cdn.jsdelivr.net/npm/nano-jsx/+esm';
+import {
+ jsx,
+ render
+} from 'https://cdn.jsdelivr.net/npm/nano-jsx/+esm';
-const Version = 6;
+const Version = 8;
const UpdateAlert = () => {
- const title = ['Update Required'];
- const message = ['You must update League Client Debloater to continue. Click here to get the latest version. After replacing with the new version, click reload.'];
- const refreshText = ['Reload'];
- const quitText = ['Quit'];
- const refresh = () => location.reload();
- const shutdown = () => fetch('/process-control/v1/process/quit', { method: 'POST' });
-
- return jsx/*html*/`
+ const title = ['Update Required'];
+ const message = ['You must update League Client Debloater to continue. Click here to get the latest version. After replacing with the new version, click reload.'];
+ const refreshText = ['Reload'];
+ const quitText = ['Quit'];
+ const refresh = () => location.reload();
+ const shutdown = () => fetch('/process-control/v1/process/quit', {
+ method: 'POST'
+ });
+
+ return jsx`
@@ -345,86 +385,86 @@ const UpdateAlert = () => {
};
window.addEventListener('load', async () => {
- const delay = (t) => new Promise(r => setTimeout(r, t));
- const manager = () => document.getElementById('lol-uikit-layer-manager-wrapper');
+ const delay = (t) => new Promise(r => setTimeout(r, t));
+ const manager = () => document.getElementById('lol-uikit-layer-manager-wrapper');
- try {
- const response = await fetch('https://raw.githubusercontent.com/Cat1Bot/LeagueClientDebloater/refs/heads/main/updatecfg.json');
+ try {
+ const response = await fetch('https://raw.githubusercontent.com/Cat1Bot/LeagueClientDebloater/refs/heads/main/updatecfg.json');
- if (!response.ok) {
- throw new Error(`Network response was not ok: ${response.statusText}`);
- }
+ if (!response.ok) {
+ throw new Error(`Network response was not ok: ${response.statusText}`);
+ }
- const config = await response.json();
+ const config = await response.json();
- let updateRequired = false;
- let modifyResponse = false;
+ let updateRequired = false;
+ let modifyResponse = false;
- if (Version < config.minversion) {
- updateRequired = true;
- }
+ if (Version < config.minversion) {
+ updateRequired = true;
+ }
- if (Version < config.latestversion) {
- modifyResponse = true;
- }
+ if (Version < config.latestversion) {
+ modifyResponse = true;
+ }
- if (updateRequired) {
- while (!manager()) {
- await delay(1200);
- }
+ if (updateRequired) {
+ while (!manager()) {
+ await delay(1200);
+ }
- const root = document.createElement('div');
- render(UpdateAlert, root);
- manager().appendChild(root);
- }
+ const root = document.createElement('div');
+ render(UpdateAlert, root);
+ manager().appendChild(root);
+ }
- if (modifyResponse) {
- let _xhrOriginalOpen = XMLHttpRequest.prototype.open;
+ if (modifyResponse) {
+ let _xhrOriginalOpen = XMLHttpRequest.prototype.open;
- XMLHttpRequest.prototype.open = function(_, url) {
- if (url === "/lol-service-status/v1/ticker-messages") {
- let originalSend = this.send;
+ XMLHttpRequest.prototype.open = function(_, url) {
+ if (url === "/lol-service-status/v1/ticker-messages") {
+ let originalSend = this.send;
- this.send = function(body) {
- let originalOnReadyStateChanged = this.onreadystatechange;
+ this.send = function(body) {
+ let originalOnReadyStateChanged = this.onreadystatechange;
- this.onreadystatechange = function(ev) {
- if (this.readyState === 4) {
- let originalContent = JSON.parse(this.responseText);
+ this.onreadystatechange = function(ev) {
+ if (this.readyState === 4) {
+ let originalContent = JSON.parse(this.responseText);
- const customMessage = {
- createdAt: "",
- heading: "Plugin Update Available",
- message: "A newer version of League Client Debloater is available. Click here to get the latest version.",
- severity: "warn",
- updatedAt: ""
- };
+ const customMessage = {
+ createdAt: "",
+ heading: "Plugin Update Available",
+ message: "A newer version of League Client Debloater is available. Click here to get the latest version.",
+ severity: "warn",
+ updatedAt: ""
+ };
- originalContent.push(customMessage);
+ originalContent.push(customMessage);
- const updatedContent = JSON.stringify(originalContent);
+ const updatedContent = JSON.stringify(originalContent);
- Object.defineProperty(this, 'responseText', {
- writable: true,
- value: updatedContent
- });
+ Object.defineProperty(this, 'responseText', {
+ writable: true,
+ value: updatedContent
+ });
- return originalOnReadyStateChanged.apply(this, [ev]);
- }
+ return originalOnReadyStateChanged.apply(this, [ev]);
+ }
- return originalOnReadyStateChanged.apply(this, arguments);
- };
+ return originalOnReadyStateChanged.apply(this, arguments);
+ };
- originalSend.apply(this, [body]);
- };
- }
+ originalSend.apply(this, [body]);
+ };
+ }
- _xhrOriginalOpen.apply(this, arguments);
- };
+ _xhrOriginalOpen.apply(this, arguments);
+ };
+ }
+ } catch (error) {
+ console.error('Failed to load config:', error);
}
- } catch (error) {
- console.error('Failed to load config:', error);
- }
});
class j {
@@ -433,6 +473,7 @@ class j {
}
}
let f;
+
function E(e) {
if (f != null) throw new Error("UPL is already initialized!");
f = new j(e);
@@ -447,16 +488,25 @@ class g {
}
let u = {};
const x = new g(B);
+
function P(e, o) {
x.trigger();
var t = u[e];
- t === void 0 ? (u[e] = { pre_callback: o, post_callback: void 0 }) : (u[e].pre_callback = o);
+ t === void 0 ? (u[e] = {
+ pre_callback: o,
+ post_callback: void 0
+ }) : (u[e].pre_callback = o);
}
+
function T(e, o) {
x.trigger();
var t = u[e];
- t === void 0 ? (u[e] = { pre_callback: void 0, post_callback: o }) : (u[e].post_callback = o);
+ t === void 0 ? (u[e] = {
+ pre_callback: void 0,
+ post_callback: o
+ }) : (u[e].post_callback = o);
}
+
function M(e, o) {
P(e, (t, n, i) => {
if (typeof n != "string") return console.error("UPL: Tried to hook text XHR request but body is not a string!"), i(n);
@@ -465,21 +515,26 @@ function M(e, o) {
});
});
}
+
function L(e, o) {
T(e, (t, n) => {
if (t.responseType !== "" && t.responseType !== "text") return console.error("UPL: Tried to hook text XHR request but response is not a string!"), n();
const i = (r) => {
- t.responseText != r && Object.defineProperty(t, "responseText", { writable: !0, value: r }), n();
+ t.responseText != r && Object.defineProperty(t, "responseText", {
+ writable: !0,
+ value: r
+ }), n();
};
o(this.responseText, i);
});
}
const U = XMLHttpRequest.prototype.open;
+
function z(e, o) {
var t = u[o.toString()];
if (t !== void 0) {
let n = this.send;
- this.send = function (i) {
+ this.send = function(i) {
if (i instanceof Document) return n.apply(this, [i]);
if (t.pre_callback !== void 0) {
let r = (c) => {
@@ -489,7 +544,7 @@ function z(e, o) {
}
if (t.post_callback !== void 0) {
let r = this.onreadystatechange;
- this.onreadystatechange = function (c) {
+ this.onreadystatechange = function(c) {
if (this.readyState === 4 && t.post_callback !== void 0) {
let h = () => {
r.apply(this, [c]);
@@ -505,15 +560,26 @@ function z(e, o) {
}
U.apply(this, arguments);
}
+
function B() {
XMLHttpRequest.prototype.open = z;
}
-const D = Object.freeze(Object.defineProperty({ __proto__: null, hookPost: T, hookPre: P, hookTextPost: L, hookTextPre: M }, Symbol.toStringTag, { value: "Module" }));
+const D = Object.freeze(Object.defineProperty({
+ __proto__: null,
+ hookPost: T,
+ hookPre: P,
+ hookTextPost: L,
+ hookTextPre: M
+}, Symbol.toStringTag, {
+ value: "Module"
+}));
let O = {};
const H = new g(N);
+
function S(e, o) {
H.trigger(), (O[e] = o);
}
+
function I(e, o) {
S(e, (t, n) => {
if (typeof t != "string") return console.error("UPL: Tried to hook text websocket endpoint but content is not a string!"), n(t);
@@ -522,31 +588,32 @@ function I(e, o) {
});
});
}
+
function N() {
let e = f?.Context;
if (e == null) throw new Error("UPL is not initialized!");
e.rcp.postInit("rcp-fe-common-libs", async (o) => {
let t = o.getDataBinding;
- o.getDataBinding = async function (n) {
+ o.getDataBinding = async function(n) {
let i = await t.apply(this, arguments),
- r = function (c, h) {
+ r = function(c, h) {
let a = i.apply(this, arguments),
d = a.cache,
y = d._triggerResourceObservers;
return (
- (d._triggerResourceObservers = function (l, p, m) {
+ (d._triggerResourceObservers = function(l, p, m) {
const _ = O[l];
- return _ == null
- ? y.apply(this, [l, p, m])
- : _(p, (C) => {
- y.apply(this, [l, C, m]);
- });
+ return _ == null ?
+ y.apply(this, [l, p, m]) :
+ _(p, (C) => {
+ y.apply(this, [l, C, m]);
+ });
}),
a
);
};
return (
- (r.bindTo = function (c) {
+ (r.bindTo = function(c) {
let h = i.bindTo.apply(this, arguments);
return (h.dataBinding = r), h;
}),
@@ -555,44 +622,80 @@ function N() {
};
});
}
-const R = Object.freeze(Object.defineProperty({ __proto__: null, hook: S, hookText: I }, Symbol.toStringTag, { value: "Module" })),
+const R = Object.freeze(Object.defineProperty({
+ __proto__: null,
+ hook: S,
+ hookText: I
+ }, Symbol.toStringTag, {
+ value: "Module"
+ })),
v = new Map(),
k = [],
b = new g(J);
+
function q(e, o, t) {
b.trigger();
- var n = { method: o, callback: t },
+ var n = {
+ method: o,
+ callback: t
+ },
i = v.get(e);
- i === void 0 ? v.set(e, { hooks: [n], mixins: [] }) : i.hooks.push(n);
+ i === void 0 ? v.set(e, {
+ hooks: [n],
+ mixins: []
+ }) : i.hooks.push(n);
}
+
function X(e, o, t) {
b.trigger();
- var n = { method: o, callback: t };
- k.push({ matcher: e, entry: { hooks: [n], mixins: [] } });
+ var n = {
+ method: o,
+ callback: t
+ };
+ k.push({
+ matcher: e,
+ entry: {
+ hooks: [n],
+ mixins: []
+ }
+ });
}
+
function A(e, o) {
b.trigger();
var t = v.get(e);
- t === void 0 ? v.set(e, { hooks: [], mixins: [o] }) : t.mixins.push(o);
+ t === void 0 ? v.set(e, {
+ hooks: [],
+ mixins: [o]
+ }) : t.mixins.push(o);
}
+
function K(e, o) {
- b.trigger(), k.push({ matcher: e, entry: { hooks: [], mixins: [o] } });
+ b.trigger(), k.push({
+ matcher: e,
+ entry: {
+ hooks: [],
+ mixins: [o]
+ }
+ });
}
+
function J() {
let e = f?.Context;
if (e == null) throw new Error("UPL is not initialized!");
e.rcp.postInit("rcp-fe-ember-libs", async (o) => {
const t = o.getEmber;
- o.getEmber = function (...n) {
+ o.getEmber = function(...n) {
const i = t.apply(this, n);
return (
i.then((r) => {
const c = r.Component.extend;
return (
- (r.Component.extend = function (...h) {
+ (r.Component.extend = function(...h) {
let a = c.apply(this, arguments);
const d = h.filter((l) => typeof l == "object");
- for (const l of d) for (const p of k) p.matcher(l) && (a = w(r, p.entry, a));
+ for (const l of d)
+ for (const p of k) p.matcher(l) && (a = w(r, p.entry, a));
const y = d.filter((l) => l.classNames && Array.isArray(l.classNames)).map((l) => l.classNames.join(" "));
for (const l of y) {
const p = v.get(l);
@@ -608,6 +711,7 @@ function J() {
};
});
}
+
function w(e, o, t) {
const n = t.proto();
if (n.__UPL_IS_HOOKED) return t;
@@ -615,7 +719,7 @@ function w(e, o, t) {
for (const i of o.mixins) t = t.extend(i(e));
for (const i of o.hooks) {
const r = n[i.method];
- n[i.method] = function (...c) {
+ n[i.method] = function(...c) {
const h = (...a) => {
if (r != null) return r.apply(this, a);
};
@@ -624,20 +728,43 @@ function w(e, o, t) {
}
return t;
}
-const G = Object.freeze(Object.defineProperty({ __proto__: null, extendClassByMatching: K, extendClassByName: A, hookComponentMethodByMatching: X, hookComponentMethodByName: q }, Symbol.toStringTag, { value: "Module" })),
- s = Object.freeze(Object.defineProperty({ __proto__: null, ember: G, ws: R, xhr: D }, Symbol.toStringTag, { value: "Module" }));
+const G = Object.freeze(Object.defineProperty({
+ __proto__: null,
+ extendClassByMatching: K,
+ extendClassByName: A,
+ hookComponentMethodByMatching: X,
+ hookComponentMethodByName: q
+ }, Symbol.toStringTag, {
+ value: "Module"
+ })),
+ s = Object.freeze(Object.defineProperty({
+ __proto__: null,
+ ember: G,
+ ws: R,
+ xhr: D
+ }, Symbol.toStringTag, {
+ value: "Module"
+ }));
+
function Q(e) {
if (e.rcp === void 0 || typeof e.rcp.preInit != "function" || typeof e.rcp.postInit != "function") throw new Error("context is not a valid Pengu Context!");
E(e);
}
+
function $(e) {
Q(e),
- s.ws.hook("/lol-login/v1/session", (o, t) => {
- (o.connected = !0), (o.state = "SUCCEEDED"), (o.error = null), t(o);
+ s.ws.hook("/lol-gameflow/v1/player-kicked-vanguard", (o, t) => {
+ (o = !1), t(o);
+ }),
+ s.ws.hook("/lol-client-config/v3/client-config/lol.client_settings.display_legacy_patch_numbers", (o, t) => {
+ (o = !0), t(o);
}),
s.xhr.hookPost("/lol-leaver-buster/v1/notifications", (o, t) => {
const n = JSON.stringify({});
- Object.defineProperty(o, "responseText", { writable: !0, value: n }), t();
+ Object.defineProperty(o, "responseText", {
+ writable: !0,
+ value: n
+ }), t();
}),
s.ws.hook("/lol-missions/v1/series", (o, t) => {}),
s.ws.hook("/lol-missions/v1/missions", (o, t) => {}),
@@ -660,4 +787,6 @@ function $(e) {
s.ws.hook("/lol-player-behavior/v1/chat-restriction", (o, t) => {}),
s.ws.hook("/lol-player-behavior/v1/code-of-conduct-notification", (o, t) => {});
}
-export { $ as init };
+export {
+ $ as init
+};
\ No newline at end of file