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