Fixed being able to unload splitted tabs

This commit is contained in:
mr. M 2024-11-02 20:45:07 +01:00
parent b32f4a3030
commit f49c256194
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB

View file

@ -226,8 +226,9 @@
unloadTab() { unloadTab() {
const tabs = TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab]; const tabs = TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab];
for (let i = 0; i < tabs.length; i++) { for (let i = 0; i < tabs.length; i++) {
const tab = tabs[i]; if (this.canUnloadTab(tabs[i], Date.now(), [], true)) {
this.unload(tab); this.unload(tabs[i]);
}
} }
} }
@ -247,7 +248,7 @@
} }
} }
canUnloadTab(tab, currentTimestamp, excludedUrls) { canUnloadTab(tab, currentTimestamp, excludedUrls, ignoreTimestamp = false) {
if ( if (
tab.pinned || tab.pinned ||
tab.selected || tab.selected ||
@ -257,6 +258,7 @@
!tab.linkedPanel || !tab.linkedPanel ||
tab.splitView || tab.splitView ||
tab.attention || tab.attention ||
tab.linkedBrowser?.zenModeActive ||
tab.pictureinpicture || tab.pictureinpicture ||
tab.soundPlaying || tab.soundPlaying ||
tab.zenIgnoreUnload || tab.zenIgnoreUnload ||
@ -264,6 +266,9 @@
) { ) {
return false; return false;
} }
if (ignoreTimestamp) {
return true;
}
const lastActivity = tab.lastActivity; const lastActivity = tab.lastActivity;
if (!lastActivity) { if (!lastActivity) {
return false; return false;