Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/browser-ctrlTab.js b/browser/components/tabbrowser/content/browser-ctrlTab.js
index 958728cde19dd7cc24692baa89e11fcab816ab82..32e2b6af2536133f170bd5e14c47392ded8440eb 100644
index 958728cde19dd7cc24692baa89e11fcab816ab82..92de87cc8461146e0040ca8a59710bf5d46d685f 100644
--- a/browser/components/tabbrowser/content/browser-ctrlTab.js
+++ b/browser/components/tabbrowser/content/browser-ctrlTab.js
@@ -249,7 +249,8 @@ var ctrlTab = {
Expand All @@ -12,7 +12,31 @@ index 958728cde19dd7cc24692baa89e11fcab816ab82..32e2b6af2536133f170bd5e14c47392d
},

init: function ctrlTab_init() {
@@ -460,7 +461,7 @@ var ctrlTab = {
@@ -452,7 +453,22 @@ var ctrlTab = {

remove: function ctrlTab_remove(aPreview) {
if (aPreview._tab) {
- gBrowser.removeTab(aPreview._tab);
+ const tab = aPreview._tab;
+
+ if (tab.hasAttribute("zen-essential") || tab.pinned) {
+ // Unload essential/pinned tabs instead of removing them
+ gZenPinnedTabManager.onCloseTabShortcut(
+ new KeyboardEvent('keydown', { key: 'w', ctrlKey: true }),
+ tab
+ );
+ // Manually update UI since unloading doesn't trigger TabClose
+ this.detachTab(tab);
+ if (this.isOpen) {
+ this.removeClosingTabFromUI(tab);
+ }
+ } else {
+ gBrowser.removeTab(tab);
+ }
}
},

@@ -460,7 +476,7 @@ var ctrlTab = {
// If the tab is hidden, don't add it to the list unless it's selected
// (Normally hidden tabs would be unhidden when selected, but that doesn't
// happen for Firefox View).
Expand All @@ -21,7 +45,7 @@ index 958728cde19dd7cc24692baa89e11fcab816ab82..32e2b6af2536133f170bd5e14c47392d
return;
}

@@ -484,7 +485,7 @@ var ctrlTab = {
@@ -484,7 +500,7 @@ var ctrlTab = {
},

open: function ctrlTab_open() {
Expand All @@ -30,7 +54,7 @@ index 958728cde19dd7cc24692baa89e11fcab816ab82..32e2b6af2536133f170bd5e14c47392d
return;
}

@@ -763,7 +764,7 @@ var ctrlTab = {
@@ -763,7 +779,7 @@ var ctrlTab = {
_initRecentlyUsedTabs() {
this._recentlyUsedTabs = Array.prototype.filter.call(
gBrowser.tabs,
Expand Down