aboutsummaryrefslogtreecommitdiffstats
path: root/extension
diff options
context:
space:
mode:
authorOmar Rizwan <omar.rizwan@gmail.com>2018-11-11 05:32:44 -0800
committerOmar Rizwan <omar.rizwan@gmail.com>2018-11-11 05:32:44 -0800
commit4ca75894c16ea3be1e4c19a7469f1595c18b2f63 (patch)
treeff08e7383db023c05ad444b9fd0d512d426689e3 /extension
parent3708425a99b8cda83f7fc0f1ce4e5c38948de065 (diff)
WebSocket communication seems to work.
Diffstat (limited to 'extension')
-rw-r--r--extension/background.js11
-rw-r--r--extension/manifest.json12
2 files changed, 23 insertions, 0 deletions
diff --git a/extension/background.js b/extension/background.js
new file mode 100644
index 0000000..3fa39c1
--- /dev/null
+++ b/extension/background.js
@@ -0,0 +1,11 @@
+const ws = new WebSocket("ws://localhost:8888");
+
+ws.onmessage = function(event) {
+ const req = JSON.parse(event.data);
+
+ const response = {
+ names: [".", "..", "hi.txt"]
+ };
+
+ ws.send(JSON.stringify(response));
+};
diff --git a/extension/manifest.json b/extension/manifest.json
new file mode 100644
index 0000000..0049977
--- /dev/null
+++ b/extension/manifest.json
@@ -0,0 +1,12 @@
+{
+ "manifest_version": 2,
+
+ "name": "ChromeFS Extension",
+ "description": "Connects to ChromeFS filesystem",
+ "version": "1.0",
+
+ "background": {
+ "scripts": ["background.js"],
+ "persistent": true
+ }
+}