Final nobranch
This commit is contained in:
parent
1040650ae4
commit
cc55db87b7
|
@ -26752,6 +26752,7 @@ class BetterDiscord {
|
|||
constructor() {
|
||||
Global.first();
|
||||
window.bdUtils = Utils;
|
||||
window.wpm = WebpackModules;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27624,17 +27625,6 @@ class SocketProxy extends Module {
|
|||
const wsHook = Global.getObject('wsHook');
|
||||
|
||||
wsHook.addEventListener('message', this.onmessage);
|
||||
|
||||
////TODO make this better and bind other events
|
||||
/* const onMessageHook = setInterval(() => {
|
||||
if (wsHook.onmessage !== null) {
|
||||
clearInterval(onMessageHook);
|
||||
//Discord sets onmessage twice so a timeout for now
|
||||
setTimeout(() => {
|
||||
wsHook.onmessage = Utils.overload(wsHook.onmessage, this.onmessage);
|
||||
}, 2000);
|
||||
}
|
||||
}, 100);*/
|
||||
}
|
||||
|
||||
onmessage(e) {
|
||||
|
|
|
@ -17,6 +17,7 @@ class BetterDiscord {
|
|||
constructor() {
|
||||
Global.first();
|
||||
window.bdUtils = Utils;
|
||||
window.wpm = WebpackModules;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,24 +34,7 @@
|
|||
console.info(`[BetterDiscord|WebSocket Proxy] WebSocket stored to __bd['wsHook']`);
|
||||
window.__bd.wsHook = this;
|
||||
}
|
||||
|
||||
/* set onmessage(fn) {
|
||||
//Don't set it
|
||||
this.__onmessage = fn;
|
||||
console.log(fn);
|
||||
console.log("Attempted to set onmessage");
|
||||
}
|
||||
|
||||
onmessage(e) {
|
||||
console.log("ON MESSAGE!!!!!!!!!!!!!!!!!!!!");
|
||||
if (this.__onmessage) this.__onmessage(e);
|
||||
}*/
|
||||
|
||||
/* onmessage(e) {
|
||||
console.log("ON MESSAGE!");
|
||||
if (this.__onmessage) this.__onmessage(e);
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
window.WebSocket = WSHook;
|
||||
|
|
Loading…
Reference in New Issue