From 7388e58ddd8d78e0e8c68c8181131d478be4999d Mon Sep 17 00:00:00 2001 From: Bill13579 <35489013+Bill13579@users.noreply.github.com> Date: Sat, 21 Sep 2024 06:10:23 +0800 Subject: [PATCH] Reverse regression of sending tabs to windows through tab strip context menu; fixes #205 --- src/background/background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/background/background.js b/src/background/background.js index 7234a48..ae8134b 100644 --- a/src/background/background.js +++ b/src/background/background.js @@ -4,6 +4,7 @@ import { ExecutionState } from "../tapi/ping"; import { TSession } from "../tapi/tsession"; import { TTabActions } from "../tapi/taction"; import LZString from "lz-string"; +import { TargetBrowser } from "../polyfill"; // import { TSession } from "tapi/tsession"; @@ -46,10 +47,12 @@ browser.contextMenus.onClicked.addListener((info, tab) => { }); let updateContextMenu = async () => { await browser.contextMenus.removeAll(); + let contexts = ["audio", "editable", "frame", "image", "link", "page", "selection", "video"]; + if (TargetBrowser === "firefox") contexts.push("tab"); await browser.contextMenus.create({ id: "tabby-send-tab-to-", title: "Send Tab to...", - contexts: ["audio", "editable", "frame", "image", "link", "page", "selection", "video"], + contexts, }); let windows = await browser.windows.getAll({ populate: false,