From 65ac88f771240547285838356dc345ee4161b007 Mon Sep 17 00:00:00 2001 From: elijahr2411 Date: Sun, 29 Jan 2023 19:55:25 -0500 Subject: [PATCH] Make all guac messages fire an event as opposed to unhandled ones, to make scripting easier --- src/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index da0dd3c..5d43aab 100644 --- a/src/index.js +++ b/src/index.js @@ -120,6 +120,7 @@ class CollabVMClient { } async #onMessage(event) { var msgArr = guacutils.decode(event.data); + window.cvmEvents.emit(msgArr[0], msgArr.slice(1)); switch (msgArr[0]) { case "nop": this.socket.send("3.nop;"); @@ -364,9 +365,6 @@ class CollabVMClient { qemuMonitorOutput.scrollTop = qemuMonitorOutput.scrollHeight; break; } - break; - default: - window.cvmEvents.emit(msgArr[0], msgArr.slice(1)); break; } }