Final nobranch

This commit is contained in:
Jiiks 2018-01-15 13:59:45 +02:00
parent 1040650ae4
commit cc55db87b7
3 changed files with 3 additions and 29 deletions

View File

@ -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) {

View File

@ -17,6 +17,7 @@ class BetterDiscord {
constructor() {
Global.first();
window.bdUtils = Utils;
window.wpm = WebpackModules;
}
}

View File

@ -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;