-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlegacy-honor.js
36 lines (29 loc) · 1.14 KB
/
legacy-honor.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
32
33
34
35
36
let _xhrOriginalOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(_, url) {
if (url === "/lol-honor-v2/v1/config") {
let originalSend = this.send;
this.send = function(body) {
let originalOnReadyStateChanged = this.onreadystatechange;
this.onreadystatechange = function(ev) {
if (this.readyState === 4) {
const content = JSON.stringify({
Enabled: true,
HonorSuggestionsEnabled: true,
HonorVisibilityEnabled: false,
SecondsToVote: 90,
ceremonyV3Enabled: false,
honorEndpointsV2Enabled: 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);
};