TabFS/extension/background.js

16 lines
297 B
JavaScript
Raw Normal View History

2018-11-11 14:32:44 +01:00
const ws = new WebSocket("ws://localhost:8888");
ws.onmessage = function(event) {
const req = JSON.parse(event.data);
2018-11-11 20:44:36 +01:00
let response;
if (req.op === "readdir") {
response = {
op: "readdir",
names: [".", "..", "hi.txt"]
};
}
2018-11-11 14:32:44 +01:00
ws.send(JSON.stringify(response));
};