From 52eb7131650386fedc4c2477c1e7fc2fc06adaa3 Mon Sep 17 00:00:00 2001 From: mikelinsi Date: Fri, 27 Dec 2024 14:20:36 +0100 Subject: for Issue #16: update backend js for create new tabs on window, update web readme --- extension/background.js | 9 ++++++++- web/tabfs.md | 13 +++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) 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//crate +``` + #### btw (this task, removing all tabs whose titles contain some string, is a -- cgit v1.2.3