diff options
Diffstat (limited to 'extension/background.js')
-rw-r--r-- | extension/background.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/extension/background.js b/extension/background.js index 3fa39c1..aa10b37 100644 --- a/extension/background.js +++ b/extension/background.js @@ -3,9 +3,13 @@ const ws = new WebSocket("ws://localhost:8888"); ws.onmessage = function(event) { const req = JSON.parse(event.data); - const response = { - names: [".", "..", "hi.txt"] - }; + let response; + if (req.op === "readdir") { + response = { + op: "readdir", + names: [".", "..", "hi.txt"] + }; + } ws.send(JSON.stringify(response)); }; |