aboutsummaryrefslogtreecommitdiffstats
path: root/extension/background.js
blob: aa10b3725a3f2eef7cb52e16bb39a94fe422e739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const ws = new WebSocket("ws://localhost:8888");

ws.onmessage = function(event) {
  const req = JSON.parse(event.data);

  let response;
  if (req.op === "readdir") {
    response = {
      op: "readdir",
      names: [".", "..", "hi.txt"]
    };
  }    

  ws.send(JSON.stringify(response));
};