mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 00:59:57 +02:00
feat(workspaces): Force container tab to open in workspace where it's assigned as default
This commit introduces a new preference, `zen.workspaces.force-container-workspace`, which allows users to automatically switch to the workspace associated with a specific tab's container.
This commit is contained in:
parent
232cb69ccf
commit
b66af853f2
1 changed files with 11 additions and 0 deletions
|
@ -879,6 +879,17 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
return [userContextId, false];
|
||||
}
|
||||
|
||||
if(Services.prefs.getBoolPref('zen.workspaces.force-container-workspace', false) && typeof userContextId !== 'undefined' && this._workspaceCache?.workspaces) {
|
||||
const workspace = this._workspaceCache.workspaces.find((workspace) => workspace.containerTabId === userContextId);
|
||||
if(workspace && workspace.uuid !== this.getActiveWorkspaceFromCache().uuid) {
|
||||
this.changeWorkspace(workspace).then(() => {
|
||||
|
||||
return [userContextId, true];
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const activeWorkspace = this.getActiveWorkspaceFromCache();
|
||||
const activeWorkspaceUserContextId = activeWorkspace?.containerTabId;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue