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 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'extension/background.js') 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].`, -- cgit v1.2.3