mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:49:59 +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() {
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue