-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadingtimefix.js
31 lines (24 loc) · 1.06 KB
/
loadingtimefix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
let _xhrOriginalOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(_, url) {
if (url === "/lol-lock-and-load/v1/should-wait-for-home-hubs" || url === "/lol-lock-and-load/v1/should-show-progress-bar-text") {
let originalSend = this.send;
this.send = function(body) {
let originalOnReadyStateChanged = this.onreadystatechange;
this.onreadystatechange = function(ev) {
if (this.readyState === 4) {
const content = JSON.stringify(
false
);
Object.defineProperty(this, 'responseText', {
writable: true,
value: content
});
return originalOnReadyStateChanged.apply(this, [ev]);
}
return originalOnReadyStateChanged.apply(this, arguments);
};
originalSend.apply(this, [body]);
};
}
_xhrOriginalOpen.apply(this, arguments);
};