卡饭有人求,也不复杂,但是吧我是习惯了中键关闭标签,弹出菜单真难受,不会用这个。

location.href.startsWith('chrome://browser/content/browser.x') && setTimeout(() => {
    eval("gBrowser.tabContainer.__proto__.handleEvent = " + gBrowser.tabContainer.__proto__.handleEvent.toString().replace("handleEvent(aEvent)", "function handleEvent(aEvent)").replace('case "mouseout":', 'case "click":\n          if(event.button === 1) {\n            event.preventDefault();\n            const tab = event.target.closest(".tabbrowser-tab");\n            TabContextMenu.contextTab = tab;\n            document.getElementById("tabContextMenu").openPopup(null, "after_pointer", event.clientX, event.clientY, false, false);\n          }\n          break;\n        case "mouseout":'));
}, 1000);