From cc55db87b77496116f74b6c89941fa3a72eea155 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Mon, 15 Jan 2018 13:59:45 +0200 Subject: [PATCH] Final nobranch --- client/dist/betterdiscord.client.js | 12 +----------- client/src/index.js | 1 + core/src/sparkplug.js | 19 +------------------ 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/client/dist/betterdiscord.client.js b/client/dist/betterdiscord.client.js index 1f489aba..77c05af6 100644 --- a/client/dist/betterdiscord.client.js +++ b/client/dist/betterdiscord.client.js @@ -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) { diff --git a/client/src/index.js b/client/src/index.js index bea87d48..167371ad 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -17,6 +17,7 @@ class BetterDiscord { constructor() { Global.first(); window.bdUtils = Utils; + window.wpm = WebpackModules; } } diff --git a/core/src/sparkplug.js b/core/src/sparkplug.js index 782cbd39..5bc5c5b1 100644 --- a/core/src/sparkplug.js +++ b/core/src/sparkplug.js @@ -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;