feat: Added 'unload all other spaces' option in spaces context menu, p=#12751

Co-authored-by: mr. m <91018726+mr-cheffy@users.noreply.github.com>
This commit is contained in:
Afeefur
2026-03-14 13:14:45 +04:00
committed by GitHub
parent 55c079d4ba
commit 7dbe5b414d
7 changed files with 127 additions and 29 deletions

View File

@@ -117,9 +117,13 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
event.stopPropagation();
if (event.getModifierState("Accel")) {
let newTab = gBrowser.duplicateTab(tab, true);
newTab.addEventListener("SSTabRestored", () => {
this._resetTabToStoredState(tab);
}, { once: true });
newTab.addEventListener(
"SSTabRestored",
() => {
this._resetTabToStoredState(tab);
},
{ once: true }
);
} else {
this._resetTabToStoredState(tab);
}
@@ -182,12 +186,13 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
if (!tab) {
return;
}
let accelHeld = e.getModifierState("Accel") || (e.metaKey && e.type == "keydown");
let accelHeld =
e.getModifierState("Accel") || (e.metaKey && e.type == "keydown");
this._setResetPinSublabel(tab, accelHeld);
// Up <-> down events until the mouse leaves the button.
// When hovered with accelHeld, we should listen to the next keyup event
let nextEvent = accelHeld ? "keyup" : "keydown";
let handler = (nextE) => this._onAccelKeyChange(nextE);
let handler = nextE => this._onAccelKeyChange(nextE);
window.addEventListener(nextEvent, handler, { once: true });
}