refactor media controls styling and improve workspace tab switching logic

This commit is contained in:
mr. M
2025-03-14 20:54:19 +01:00
parent 8afb8ee204
commit 481976a353
3 changed files with 30 additions and 29 deletions

View File

@@ -2373,9 +2373,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
async switchIfNeeded(browser, i) {
const tab = gBrowser.getTabForBrowser(browser);
const workspaceId = tab.getAttribute('zen-workspace-id');
if (!tab.hasAttribute('zen-essential') && workspaceId !== this.activeWorkspace) {
await this.changeWorkspace({ uuid: workspaceId });
await this.switchTabIfNeeded(tab);
}
async switchTabIfNeeded(tab) {
if (!tab.hasAttribute('zen-essential') && tab.getAttribute('zen-workspace-id') !== this.activeWorkspace) {
await this.changeWorkspace({ uuid: tab.getAttribute('zen-workspace-id') });
}
gBrowser.selectedTab = tab;
}