From c6845a798c99e96aa0e2f6daece0684a8ac50681 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 19 Nov 2023 16:21:29 +0100 Subject: wip --- page_action.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 page_action.js (limited to 'page_action.js') diff --git a/page_action.js b/page_action.js new file mode 100644 index 0000000..ccb7925 --- /dev/null +++ b/page_action.js @@ -0,0 +1,13 @@ +function handleClick(tab) { + const newUrl = tab.url.replace('https://', 'https+vim://'); + console.log(newUrl); + newTab = browser.tabs.create({ url: newUrl }); + + // TODO: close the tab after it's been opened + // this doesn't work as it happens too fast and the app isn't open yet + //newTab.then(function(ntab) { + //browser.tabs.remove(ntab.id); + //}) +} + +browser.pageAction.onClicked.addListener(handleClick); -- cgit v1.2.3