diff --git a/src/ZenWorkspaces.mjs b/src/ZenWorkspaces.mjs index b4b4375..85ff34e 100644 --- a/src/ZenWorkspaces.mjs +++ b/src/ZenWorkspaces.mjs @@ -18,6 +18,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { true, this._expandWorkspacesStrip.bind(this) ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'shouldForceContainerTabsToWorkspace', + 'zen.workspaces.force-container-workspace', + true + ); ChromeUtils.defineLazyGetter(this, 'tabContainer', () => document.getElementById('tabbrowser-tabs')); await ZenWorkspacesStorage.init(); if(!Weave.Service.engineManager.get("workspaces")) { @@ -879,7 +885,7 @@ 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) { + if(this.shouldForceContainerTabsToWorkspace && 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(() => {