Theseus: a background tab that is playing sound is not frozen

Freezing background tabs stopped music and talks the moment you
switched to another tab, which no other browser does. A tab that is
audible when its freeze is due is checked again later and frozen only
once it falls quiet.
This commit is contained in:
Local Dev 2026-10-04 02:23:08 +02:00
parent 449a967e21
commit a5ce638848

View file

@ -3539,6 +3539,9 @@ function scheduleFreeze(tab) {
if (!settings.freezeBackgroundTabs || tab.keepRunning || tab.pending || !tab.url || tab.id === activeId) return;
tab.freezeTimer = setTimeout(() => {
if (tab.id === activeId || !tabs.includes(tab) || tab.keepRunning || tab.pending || tabHasPendingDialog(tab.id)) return;
// A tab playing sound (music, a talk) keeps playing, as in any browser;
// check again later and freeze it once it falls quiet.
try { if (tab.view.webContents.isCurrentlyAudible()) { scheduleFreeze(tab); return; } } catch {}
setTabFrozen(tab, true);
}, FREEZE_GRACE_MS);
}