mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:39:58 +02:00
Fixed being able to unload splitted tabs
This commit is contained in:
parent
b32f4a3030
commit
f49c256194
1 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue