summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormikelinsi <mike@mikelinsi.com>2024-12-27 14:20:36 +0100
committermikelinsi <mike@mikelinsi.com>2024-12-27 14:20:36 +0100
commit52eb7131650386fedc4c2477c1e7fc2fc06adaa3 (patch)
treeae697582aabaaba885b6388ee4c47dbf413f2598
parente056ff9073470192ef4c8498aaa7e722edae87c2 (diff)
downloadTabFS-52eb7131650386fedc4c2477c1e7fc2fc06adaa3.tar.gz
TabFS-52eb7131650386fedc4c2477c1e7fc2fc06adaa3.zip
for Issue #16: update backend js for create new tabs on window, update web readme
-rw-r--r--extension/background.js9
-rw-r--r--web/tabfs.md13
2 files changed, 21 insertions, 1 deletions
diff --git a/extension/background.js b/extension/background.js
index 93933f2..64d8dd2 100644
--- a/extension/background.js
+++ b/extension/background.js
@@ -473,7 +473,14 @@ Read that file to evaluate and return the current value of that JS expression.`,
})
};
})();
-
+Routes["/windows/#WINDOW_ID/crate"] = {
+ async write({windowId, buf}) {
+ const url = buf.trim();
+ await browser.tabs.create({ windowId: windowId, url: url });
+ return {size: stringToUtf8Array(buf).length};
+ },
+ async truncate() { return {}; }
+}
Routes["/tabs/by-id/#TAB_ID/window"] = {
description: `The window that this tab lives in;
a symbolic link to the folder /windows/[id for this window].`,
diff --git a/web/tabfs.md b/web/tabfs.md
index 1cda620..ed9f31a 100644
--- a/web/tabfs.md
+++ b/web/tabfs.md
@@ -134,6 +134,19 @@ or (older / more explicit)
$ echo remove | tee -a mnt/tabs/by-title/*Stack_Overflow*/control
```
+### Open new Tabs
+just:
+
+```
+$ echo about:blank > mnt/tabs/create
+```
+
+or in a specific window:
+
+```
+$ about:blank > windows/<ID>/crate
+```
+
#### btw
(this task, removing all tabs whose titles contain some string, is a